我试图在mac (10.11.5)和Excel 2016 (15.23.2版)上使用xlwing,但我很快就被卡住了。
当我运行安装时,我会得到以下错误:
$ xlwings runpython install
Traceback (most recent call last):
File "/usr/local/bin/xlwings", line 7, in <module>
from xlwings.command_line import main
File "/Library/Python/2.7/site-packages/xlwings/command_line.py", line 22, in <module>
hfs_to_posix_path(app('Microsoft Excel').properties().get(k.templates_path))))
File "/Library/Python/2.7/site-packages/aeosa/appscript/reference.py", line 577, in __getattr__
selectortype, code = self.AS_appdata.referencebyname()[name]
File "/Library/Python/2.7/site-packages/aeosa/appscript/reference.py", line 259, in referencebyname
self.connect()
File "/Library/Python/2.7/site-packages/aeosa/appscript/reference.py", line 225, in connect
t = self._target = self._aemapplicationclass(**kargs)
File "/Library/Python/2.7/site-packages/aeosa/aem/__init__.py", line 76, in __init__
self._address = aemconnect.localapp(path, newinstance, hide)
File "/Library/Python/2.7/site-packages/aeosa/aem/aemconnect.py", line 187, in localapp
desc = _launchapplication(path, _runevent, newinstance, hide)
File "/Library/Python/2.7/site-packages/aeosa/aem/aemconnect.py", line 55, in _launchapplication
raise CantLaunchApplicationError(err.args[0], path)
aem.aemconnect.CantLaunchApplicationError: Can't launch application at u'/Applications/Microsoft Excel.app': The executable file is missing or has an unusable format. (-10827)对如何进行有什么想法吗?
版本:Python2.7.10xlwing (0.7.2) psutil (4.3.0) appscript (1.0.1)
发布于 2016-07-11 03:53:58
我发现了这个问题:基本上,我在一个与Excel不同的用户环境中运行xlwings runpython install。
发布于 2016-07-10 18:52:39
还不太清楚为什么会失败,但xlwings runpython install试图做的只是将xlwings.appscript文件从xlwings安装目录复制到以下目录:~/Library/Application Scripts/com.microsoft.Excel。因此,要解决这种情况,只需手动将文件复制到该目录(如果还不存在,则创建该目录)。通过执行以下操作,您将找到xlwings安装的路径:
>>> import xlwings as xw
>>> xw.__path__https://stackoverflow.com/questions/38295256
复制相似问题