gpt4 book ai didi

python - 在 Python 2.7 上使用 Py2app 编译应用程序时出现错误(引发 ImportError ("No module named "+ qname))

转载 作者:太空宇宙 更新时间:2023-11-03 21:41:31 24 4
gpt4 key购买 nike

我使用的是 Mac 10.14、Python 2.7(从 https://www.python.org 下载的二进制文件安装),从/Library/Frameworks/Python.framework/Versions/2.7/bin/python 运行。我安装了 py2app,最新版本,但是在尝试编译应用程序时,出现以下错误:

MacBook-Pro:Audio_Export_App kevin$ sudo python setup.py py2app
Password:
running py2app
creating /Users/kevin/python_scripts/Audio_Export_App/build
creating /Users/kevin/python_scripts/Audio_Export_App/build/bdist.macosx-10.9-x86_64
creating /Users/kevin/python_scripts/Audio_Export_App/build/bdist.macosx-10.9-x86_64/python2.7-standalone
creating /Users/kevin/python_scripts/Audio_Export_App/build/bdist.macosx-10.9-x86_64/python2.7-standalone/app
creating /Users/kevin/python_scripts/Audio_Export_App/build/bdist.macosx-10.9-x86_64/python2.7-standalone/app/collect
creating /Users/kevin/python_scripts/Audio_Export_App/build/bdist.macosx-10.9-x86_64/python2.7-standalone/app/temp
creating /Users/kevin/python_scripts/Audio_Export_App/dist
creating build/bdist.macosx-10.9-x86_64/python2.7-standalone/app/lib-dynload
creating build/bdist.macosx-10.9-x86_64/python2.7-standalone/app/Frameworks
--- Skipping recipe pyside ---
*** using recipe: subprocess ***
--- Skipping recipe pyside ---
*** using recipe: virtualenv ***
--- Skipping recipe pyside ---
--- Skipping recipe lxml ---
--- Skipping recipe PIL ---
*** using recipe: importlib ***
--- Skipping recipe pyside ---
--- Skipping recipe lxml ---
--- Skipping recipe PIL ---
*** using recipe: re ***
--- Skipping recipe pyside ---
--- Skipping recipe lxml ---
--- Skipping recipe PIL ---
Traceback (most recent call last):
File "setup.py", line 23, in <module>
setup_requires=['py2app'],
File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/setuptools/__init__.py", line 140, in setup
return distutils.core.setup(**attrs)
File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/distutils/core.py", line 151, 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 "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/py2app/build_app.py", line 838, in run
self._run()
File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/py2app/build_app.py", line 1053, in _run
self.run_normal()
File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/py2app/build_app.py", line 1150, in run_normal
self.process_recipes(mf, filters, flatpackages, loader_files)
File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/py2app/build_app.py", line 1007, in process_recipes
rval = check(self, mf)
File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/py2app/recipes/six.py", line 113, in check
mf.import_hook(nm, m)
File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/modulegraph/modulegraph.py", line 1082, in import_hook
q, tail = self._find_head_package(parent, name, level)
File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/modulegraph/modulegraph.py", line 1182, in _find_head_package
raise ImportError("No module named " + qname)
ImportError: No module named gdbm

我找不到这里出了什么问题。请问有什么建议吗?

最佳答案

此时(2018 年 12 月)Python 2.7 的 Py2app 版本存在一些问题。我设法使用旧版本让它工作:

py2app==0.16

编辑 2018 年 12 月 21 日:问题是在 0.17 中添加了对 six.moves 的支持。我报告了问题:https://bitbucket.org/ronaldoussoren/py2app/issues/257/sixmoves-recipe-broke-something

关于python - 在 Python 2.7 上使用 Py2app 编译应用程序时出现错误(引发 ImportError ("No module named "+ qname)),我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/52820180/

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