gpt4 book ai didi

python - Py2app 模块图中出现错误

转载 作者:行者123 更新时间:2023-12-01 06:15:35 25 4
gpt4 key购买 nike

几周前,我能够使用 py2app 构建应用程序。我刚刚再次尝试,在构建过程中,我被转储到 pdb session 中,堆栈跟踪如下。

它似乎存在 modulegraph.py 的导入问题,但我拥有迄今为止最新的版本。

即使只有一个最低限度的测试文件,除了 sys 之外没有任何导入,并且使用 py2applet 创建的设置,也会发生这种情况。

我还确保运行 py2app 的 python 是/Library 版本,而不是/System 版本。

有什么想法吗?

Traceback (most recent call last):
File "/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/site-packages/py2app-0.4.3-py2.6.egg/py2app/build_app.py", line 589, in _run
self.run_normal()
File "/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/site-packages/py2app-0.4.3-py2.6.egg/py2app/build_app.py", line 641, in run_normal
mf = self.get_modulefinder()
File "/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/site-packages/py2app-0.4.3-py2.6.egg/py2app/build_app.py", line 549, in get_modulefinder
debug=debug,
File "build/bdist.macosx-10.6-universal/egg/modulegraph/find_modules.py", line 255, in find_modules
find_needed_modules(mf, scripts, includes, packages)
File "build/bdist.macosx-10.6-universal/egg/modulegraph/find_modules.py", line 180, in find_needed_modules
mf.import_hook(mod[:-2], None, ['*'])
File "build/bdist.macosx-10.6-universal/egg/modulegraph/modulegraph.py", line 404, in import_hook
modules.update(self.ensure_fromlist(m, fromlist))
File "build/bdist.macosx-10.6-universal/egg/modulegraph/modulegraph.py", line 472, in ensure_fromlist
fromlist.update(self.find_all_submodules(m))
File "build/bdist.macosx-10.6-universal/egg/modulegraph/modulegraph.py", line 496, in find_all_submodules
for (path, mode, typ) in ifilter(None, imap(moduleInfoForPath, names)):
NameError: global name 'ifilter' is not defined
> /Users/justin/Desktop/test/build/bdist.macosx-10.6-universal/egg/modulegraph/modulegraph.py(496)find_all_submodules()
-> for (path, mode, typ) in ifilter(None, imap(moduleInfoForPath, names)):

最佳答案

这似乎是一个已注意到的问题here并且应该在随后的 0.8 版本 modulegraph 中得到修复。确保您的 modulegraph 版本确实是最新的;该路径有点奇怪:build/bdist.macosx-10.6-universal/egg/modulegraph。看起来您使用的是私有(private)副本,而不是作为普通站点包安装的副本,例如 py2app (/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/站点包)。

关于python - Py2app 模块图中出现错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/3502584/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com