cx_Freeze 错误,xlwings 作为带有斐波那契教程的独立版本

Error with cx_Freeze and xlwings as standalone version with fibonacci tutorial

当我将 xlwings 中的斐波那契示例编译为独立版本时,执行时出现以下错误。 我尝试在 cx_Freeze 安装脚本中使用 include_files 选项包含文件,但我一直收到错误。

有人知道如何解决这个问题吗?

Traceback (most recent call last):
  File "C:\Anaconda\lib\site-packages\cx_Freeze\initscripts\Console.py", line 27, in     <module>
  File "ioforge.py", line 10, in <module>

  File "C:\Anaconda\lib\site-packages\xlwings-0.3.0-py2.7.egg\xlwings\__init__.py",     line 18, in <module>
  File "C:\Anaconda\lib\site-packages\xlwings-0.3.0-py2.7.egg\xlwings\_xlwindows.py",     line 9, in <module>
WindowsError: [Error 123] Syntaxe du nom de fichier, de répertoire ou de volume     incorrecte: ''

出现问题的线路如下:

# Hack to find pythoncom.dll - needed for some distribution/setups
# E.g. if python is started with the full path outside of the python path, then it almost     certainly fails
cwd = os.getcwd()
os.chdir(sys.exec_prefix)
import win32api
os.chdir(cwd)

它抱怨找不到您的目录。尝试完全 uninstall/reinstall xlwings(如有必要,请检查 Anaconda\Lib\site-packages 文件夹。xlwings-0.3.0-py2.7.egg 通常称为 xlwings-0.3.0-py2.7.egg-info,所以不确定这是否是找不到它的原因。