我正在尝试在Mac OS X Snow Leopard 10.6.8中捆绑一个应用程序。我通过macports 2.3.4安装了python2.7,py27-tkinter。
我的代码在作为脚本以及py2app的别名模式运行时运行良好。但是,当我捆绑时它表现不正常:意思是,在对用户输入整数进行每次条件检查时,应该在窗口中更新结果。但是,结果仅针对第一个输入整数进行更新,并且不会为后续输入更新任何内容。当我尝试以交互方式运行时,出现以下错误:
Traceback (most recent call last): File "setup.py", line 18, in setup_requires=['py2app'], File "/opt/local/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/distutils/core.py", line 151, in setup dist.run_commands() File "/opt/local/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/distutils/dist.py", line 953, in run_commands self.run_command(cmd) File "/opt/local/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/distutils/dist.py", line 972, in run_command cmd_obj.run() File "/opt/local/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/py2app/build_app.py", line 659, in run self._run() File "/opt/local/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/py2app/build_app.py", line 865, in _run self.run_normal() File "/opt/local/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/py2app/build_app.py", line 939, in run_normal mf = self.get_modulefinder() File "/opt/local/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/py2app/build_app.py", line 814, in get_modulefinder debug=debug, File "/opt/local/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/modulegraph/find_modules.py", line 341, in find_modules find_needed_modules(mf, scripts, includes, packages) File "/opt/local/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/modulegraph/find_modules.py", line 266, in find_needed_modules path = m.packagepath[0] TypeError: 'NoneType' object has no attribute '__getitem__' >>>
有没有人可以了解这里遗漏/错误的原因以及如何解决问题并最终解决问题?
非常感谢提前。