【发布时间】:2016-07-28 18:44:59
【问题描述】:
我正在尝试使用 py2exe 编译一个用 Python 2.7(32 位)编写的眼动追踪实验。实验使用了psychopy 库。我使用 PyCharm IDE 编写了这个实验,当我通过 PyCharm IDE 运行它时,实验运行,使用位于C:\Users\phil\Python_2.7_32-bit 的虚拟环境中的解释器。
当我在命令提示符中输入以下命令时,实验编译没有产生任何错误:C:\Users\phil\Python_2.7_32-bit\Scripts\python.exe C:\Users\phil\PycharmProjects\iTRAC\VisSearch\setup.py py2exe。
当我运行上述 py2exe 命令生成的可执行文件时,我收到此错误:
Traceback (most recent call last):
File "VisualSearch.py", line 3, in <module>
File "psychopy\__init__.pyc", line 39, in <module>
File "psychopy\preferences\__init__.pyc", line 5, in <module>
File "psychopy\preferences\preferences.pyc", line 172, in <module>
File "psychopy\preferences\preferences.pyc", line 33, in __init__
File "psychopy\preferences\preferences.pyc", line 98, in loadAll
File "psychopy\preferences\preferences.pyc", line 146, in loadAppData
File "psychopy\preferences\configobj.pyc", line 583, in __getitem__
KeyError: 'builder'
我的 setup.py 脚本如下:
from distutils.core import setup
import py2exe
setup(windows =['C:\Users\phil\PycharmProjects\iTRAC\VisSearch\VisualSearch.py'])
我也尝试过使用以下 setup.py 脚本,结果相同:
from distutils.core import setup
import py2exe
setup(windows = [{'script':'C:\Users\phil\PycharmProjects\iTRAC\VisSearch\VisualSearch.py',
'options' : {'py2exe':{'includes':['psychopy'],
'compressed': True,
'bundle_files': 1,}}}])
我用谷歌搜索了错误并得出了 0 个结果。
谁能告诉我为什么会遇到这个错误?
【问题讨论】:
标签: python windows compiler-errors py2exe psychopy