py2exe找不到所有依赖项

Doo*_*Dah 6 python py2exe cx-freeze

我试图从python代码创建一个exe.我可以从命令行运行代码,如下所示:

python myScript.py
Run Code Online (Sandbox Code Playgroud)

我从这里安装了py2exe:http://sourceforge.net/projects/py2exe/files/py2exe/0.6.9/

并且,有一个如下所示的setup.py:

from distutils.core import setup
import py2exe

setup(console=['myScript.py'])
Run Code Online (Sandbox Code Playgroud)

而且,我像这样运行setup.py:

python setup.py py2exe
Run Code Online (Sandbox Code Playgroud)

我在输出中得到以下内容:

The following modules appear to be missing
['Carbon', 'Carbon.Files', '__pypy__', '_scproxy', 'http_parser.http', 'http_parser.reader', 'jinja2._debugsupport', 'jinja2._markupsafe._speedups',
'jinja2.debugrenderer', 'markupsafe', 'pretty', 'socketpool', 'socketpool.util']
Run Code Online (Sandbox Code Playgroud)

而且,果然,如果我尝试运行exe,我会收到错误:

$ ./myScript.exe
Traceback (most recent call last):
  File "restkit\__init__.pyc", line 9, in <module>
  File "restkit\conn.pyc", line 14, in <module>
ImportError: No module named socketpool
Traceback (most recent call last):
  File "myScript.py", line 12, in <module>
ImportError: cannot import name Resource
Run Code Online (Sandbox Code Playgroud)

我需要做些什么才能让py2exe找到依赖项?

谢谢

Chr*_*kes 0

py2exe 与 python 版本相关。你所做的一切似乎都是正确的,我猜你安装了错误的版本。