py2app - TypeError:'NoneType'对象没有属性'__getitem __'

时间:2018-06-08 05:55:17

标签: python macos py2app

我试图使用py2app构建一个应用程序,我已经很好地工作了很长时间。为了清理我的各种Python安装/设置virtualenv,我想我已经完全破坏了一些东西。我最终放弃了尝试正确设置virtualenv并卸载它。

(PS。我只是这样做所以我可以在VS Code中轻松切换python2和python3解释器,但VS Code无法识别venvs)

这是我得到的错误。我检查了我的模块,他们似乎都在正确的地方,虽然有些似乎在网站位置和其他用户位置 - AFAIK这没关系。

希望有人可以指出我正确的方向。

creating build/bdist.macosx-10.13-x86_64/python2.7-standalone/app/Frameworks
Traceback (most recent call last):
  File "setup.py", line 18, in <module>
    setup_requires=['py2app']
  File "/usr/local/lib/python2.7/site-packages/setuptools/__init__.py", line 129, in setup
    return distutils.core.setup(**attrs)
  File "/usr/local/Cellar/python@2/2.7.15/Frameworks/Python.framework/Versions/2.7/lib/python2.7/distutils/core.py", line 151, in setup
    dist.run_commands()
  File "/usr/local/Cellar/python@2/2.7.15/Frameworks/Python.framework/Versions/2.7/lib/python2.7/distutils/dist.py", line 953, in run_commands
    self.run_command(cmd)
  File "/usr/local/Cellar/python@2/2.7.15/Frameworks/Python.framework/Versions/2.7/lib/python2.7/distutils/dist.py", line 972, in run_command
    cmd_obj.run()
  File "/Users/michael/Library/Python/2.7/lib/python/site-packages/py2app/build_app.py", line 825, in run
    self._run()
  File "/Users/michael/Library/Python/2.7/lib/python/site-packages/py2app/build_app.py", line 1040, in _run
    self.run_normal()
  File "/Users/michael/Library/Python/2.7/lib/python/site-packages/py2app/build_app.py", line 1133, in run_normal
    mf = self.get_modulefinder()
  File "/Users/michael/Library/Python/2.7/lib/python/site-packages/py2app/build_app.py", line 984, in get_modulefinder
    debug=debug,
  File "/usr/local/lib/python2.7/site-packages/modulegraph/find_modules.py", line 338, in find_modules
    find_needed_modules(mf, scripts, includes, packages)
  File "/usr/local/lib/python2.7/site-packages/modulegraph/find_modules.py", line 256, in find_needed_modules
    path = m.packagepath[0]
TypeError: 'NoneType' object has no attribute '__getitem__'

0 个答案:

没有答案