我刚刚在MacOS 10.10.2上安装了xlwings。它运行python 2.7但我不能让它运行3.4。我尝试了pip和conda安装。
在IDLE 3.4上我甚至无法导入xlwings。我得到一个错误,说该模块不存在。
在IDLE 2.7上,我可以导入xlwings,但是当我运行
时>>> wd = Workbook()
我收到以下错误:
Traceback (most recent call last):
File "<pyshell#10>", line 1, in <module>
wd = Workbook()
File "/Library/Python/2.7/site-packages/xlwings/main.py", line 141, in __init__
self.xl_app, self.xl_workbook = xlplatform.new_workbook()
File "/Library/Python/2.7/site-packages/xlwings/_xlmac.py", line 117, in new_workbook
xl_workbook = xl_app.make(new=kw.workbook)
File "/Library/Python/2.7/site-packages/aeosa/appscript/reference.py", line 462, in __call__
return self.AS_appdata.target().event(self._code, params, atts, codecs=self.AS_appdata).send(timeout, sendflags)
File "/Library/Python/2.7/site-packages/aeosa/aem/__init__.py", line 189, in event
codecs or self._codecs, self._createproc, self._sendproc)
File "/Library/Python/2.7/site-packages/aeosa/aem/aemsend.py", line 54, in __init__
self.AEM_event.setparam(key, codecs.pack(value))
File "/Library/Python/2.7/site-packages/aeosa/appscript/reference.py", line 273, in pack
raise ValueError("Unknown Keyword: k.%s" % data.AS_name)
ValueError: Unknown Keyword: k.workbook
我完全陷入困境......我有Excel,2011和2016两个版本.Excel 2016是我的默认应用程序。我不知道这是否会对xlwings产生影响。