【发布时间】:2014-12-09 12:59:59
【问题描述】:
我想用 py2exe 将 python 脚本变成 Windows 可执行文件。我没有错过 MSVCP90.dll 和 Feiwings.py(我用于转换的文件)和 setup.py 在同一路径下。在命令窗口下做这些事情,一切正常,这里回溯的最后几行是:
**binary dependencies****
your executable(s) also depend on these dlls which are not included. You may or may not need to distribute them.
Make sure you have the license if you distribute any of them, and make sure you don't distribute files belonging to the operating system.
USER32.dll -C:\WINDOWS\system32\USER32.dll
SHELL32.dll -C:\WINDOWS\system32\SHELL32.dll
ADVAPI32.dll -C:\WINDOWS\system32\ADVAPI32.dll
WS2_32.dll -C:\WINDOWS\system32\WS2_32.dll
GDI32.dll -C:\WINDOWS\system32\GDI32.dll
KERNEL32.dll -C:\WINDOWS\system32\KERNEL32.dll
setup.py 的内容如下:
from distutils.core import setup
import py2exe
setup(console=['D:\python\Feiwings.py'])
当我 cd 到 dist 目录的路径时,它出错了。
Traceback (most recent call last):
File "Feiwings.py", line 2, in <module>
File "PySide\__init__.pyc", line 45, in <module>
File "PySide\__init__.pyc", line 43, in _setupQtDirectories
UnboundLocalError: local variable 'path' referenced before assignment
提前致谢!
【问题讨论】:
标签: python python-2.7 pyside py2exe