0

我正在尝试使用虚拟 python 环境使用 py2app 构建应用程序。我有 python 2.7.3。我可以使用 python 2.6(我有 py2app)很好地构建应用程序,但不能使用我的 2.7.3 virtualenv(因为我无法在我的 2.7.3 系统范围安装中安装 py2app)。

这是我得到的错误:

running py2app
creating /Users/student/Desktop/Coding Projects/MCManager/build/bdist.macosx-10.6-intel/python2.7-standalone/app
creating /Users/student/Desktop/Coding Projects/MCManager/build/bdist.macosx-10.6-intel/python2.7-standalone/app/collect
creating /Users/student/Desktop/Coding Projects/MCManager/build/bdist.macosx-10.6-intel/python2.7-standalone/app/temp
creating build/bdist.macosx-10.6-intel/python2.7-standalone/app/lib-dynload
creating build/bdist.macosx-10.6-intel/python2.7-standalone/app/Frameworks
Traceback (most recent call last):
  File "AppSpec.py", line 21, in <module>
    app = ['ScriptUnix.py']
  File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/distutils/core.py", line 152, in setup
    dist.run_commands()
  File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/distutils/dist.py", line 953, in run_commands
    self.run_command(cmd)
  File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/distutils/dist.py", line 972, in run_command
    cmd_obj.run()
  File "/Users/student/Desktop/VE/MyVirtEnv/lib/python2.7/site-packages/py2app/build_app.py", line 520, in run
    self._run()
  File "/Users/student/Desktop/VE/MyVirtEnv/lib/python2.7/site-packages/py2app/build_app.py", line 708, in _run
    self.run_normal()
  File "/Users/student/Desktop/VE/MyVirtEnv/lib/python2.7/site-packages/py2app/build_app.py", line 779, in run_normal
    mf = self.get_modulefinder()
  File "/Users/student/Desktop/VE/MyVirtEnv/lib/python2.7/site-packages/py2app/build_app.py", line 658, in get_modulefinder
    debug=debug,
  File "/Users/student/Desktop/VE/MyVirtEnv/lib/python2.7/site-packages/modulegraph/find_modules.py", line 271, in find_modules
    find_needed_modules(mf, scripts, includes, packages)
  File "/Users/student/Desktop/VE/MyVirtEnv/lib/python2.7/site-packages/modulegraph/find_modules.py", line 196, in find_needed_modules
    path = m.packagepath[0]
TypeError: 'NoneType' object has no attribute '__getitem__'

我在 py2app 安装文件的目录中,使用~/Desktop/VE/MyVirtEnv/bin/python AppSpec.py py2app. 如果我用 运行相同的东西python26 AppSpec.py py2app,它工作正常。

4

0 回答 0