僵尸进程运行xlwings

时间:2015-12-04 05:27:23

标签: xlwings

尝试使用xlwings时出现python错误。只是导入xlwings似乎足以触发问题。

Lewis-MacBook-Air:~ lewis$ python
Python 2.7.10 |Anaconda 2.3.0 (x86_64)| (default, Oct 19 2015, 18:31:17) 
[GCC 4.2.1 (Apple Inc. build 5577)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
Anaconda is brought to you by Continuum Analytics.
Please check out: http://continuum.io/thanks and https://anaconda.org
>>> import xlwings
>>> xlwings.__version__
'0.6.0'
>>> exit()
Error in atexit._run_exitfuncs:
Traceback (most recent call last):
  File "/Users/lewis/anaconda/lib/python2.7/atexit.py", line 24, in _run_exitfuncs
    func(*targs, **kargs)
  File "/Users/lewis/anaconda/lib/python2.7/site-packages/xlwings/_xlmac.py", line 47, in clean_up
    if is_excel_running():
  File "/Users/lewis/anaconda/lib/python2.7/site-packages/xlwings/_xlmac.py", line 98, in is_excel_running
    if proc.name() == 'Microsoft Excel':
  File "/Users/lewis/anaconda/lib/python2.7/site-packages/psutil/__init__.py", line 539, in name
    cmdline = self.cmdline()
  File "/Users/lewis/anaconda/lib/python2.7/site-packages/psutil/__init__.py", line 592, in cmdline
    return self._proc.cmdline()
  File "/Users/lewis/anaconda/lib/python2.7/site-packages/psutil/_psosx.py", line 209, in wrapper
    raise ZombieProcess(self.pid, self._name, self._ppid)
ZombieProcess: psutil.ZombieProcess process still exists but it's a zombie (pid=71)
Error in sys.exitfunc:
Traceback (most recent call last):
  File "/Users/lewis/anaconda/lib/python2.7/atexit.py", line 24, in _run_exitfuncs
    func(*targs, **kargs)
  File "/Users/lewis/anaconda/lib/python2.7/site-packages/xlwings/_xlmac.py", line 47, in clean_up
    if is_excel_running():
  File "/Users/lewis/anaconda/lib/python2.7/site-packages/xlwings/_xlmac.py", line 98, in is_excel_running
    if proc.name() == 'Microsoft Excel':
  File "/Users/lewis/anaconda/lib/python2.7/site-packages/psutil/__init__.py", line 539, in name
    cmdline = self.cmdline()
  File "/Users/lewis/anaconda/lib/python2.7/site-packages/psutil/__init__.py", line 592, in cmdline
    return self._proc.cmdline()
  File "/Users/lewis/anaconda/lib/python2.7/site-packages/psutil/_psosx.py", line 209, in wrapper
    raise ZombieProcess(self.pid, self._name, self._ppid)
psutil.ZombieProcess: psutil.ZombieProcess process still exists but it's a zombie (pid=71)
Lewis-MacBook-Air:~ lewis$ 

使用Workbook.caller()从Excel调用python工作正常。

我正在运行El Capitan 10.11.2(Beta 5)。

任何建议表示赞赏。

1 个答案:

答案 0 :(得分:0)

似乎3.3.0的版本psutil导致了此问题,因为已记录here

目前,降级到pip install psutil==3.2.2应该会有所帮助,直到修复为止。

<强>更新: 这已通过v0.6.1

修复