You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Just following the example in the README. Changing proc.name() to proc.name fixes the problem. Python 2.7 (Anaconda) on OS X.
In [1]: from xlwings import Workbook, Range, Chart
In [2]: wb=Workbook()
---------------------------------------------------------------------------
TypeError Traceback (most recent call last)
<ipython-input-2-fa7edd33f875> in <module>()
----> 1 wb=Workbook()
/Users/pwang/anaconda/lib/python2.7/site-packages/xlwings/main.pyc in __init__(self, fullname)
68 else:
69 # Open Excel if necessary and create a new workbook
---> 70 self.xl_app, self.xl_workbook = xlplatform.new_workbook()
71
72 self.name = xlplatform.get_workbook_name(self.xl_workbook)
/Users/pwang/anaconda/lib/python2.7/site-packages/xlwings/_xlmac.pyc in new_workbook()
73
74 def new_workbook():
---> 75 is_running = is_excel_running()
76
77 xl_app = app('Microsoft Excel')
/Users/pwang/anaconda/lib/python2.7/site-packages/xlwings/_xlmac.pyc in is_excel_running()
30 def is_excel_running():
31 for proc in psutil.process_iter():
---> 32 if proc.name() == 'Microsoft Excel':
33 return True
34 return False
TypeError: 'str' object is not callable
The text was updated successfully, but these errors were encountered:
pzwang
changed the title
proc.name is a string, not a function (in is_excel_running())
proc.name is a string, not a function (in is_excel_running())
Jul 30, 2014
According to here, this error happens with psutil 1.2.1. What would you say makes more sense, require a minimum psutil version in setup.py or wrap it into a try/except TypeError block?
Just following the example in the README. Changing
proc.name()
toproc.name
fixes the problem. Python 2.7 (Anaconda) on OS X.The text was updated successfully, but these errors were encountered: