python – Py2App:别名模式有效,但部署没有
作者:互联网
我正在尝试使用py2app部署我的python应用程序.
我使用以下命令创建了安装文件:py2applet –make-setup MyApplication.py
然后我这样做测试它:python setup.py py2app -A
这也很有效.我的GUI程序运行.
当我尝试最后一步:python setup.py py2app
我得到这个胖子错误.
Traceback (most recent call last):
File "setup.py", line 18, in <module>
setup_requires=['py2app'],
File "/usr/local/Cellar/python/2.7.8_1/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.7.8_1/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.7.8_1/Frameworks/Python.framework/Versions/2.7/lib/python2.7/distutils/dist.py", line 972, in run_command
cmd_obj.run()
File "/usr/local/lib/python2.7/site-packages/py2app/build_app.py", line 659, in run
self._run()
File "/usr/local/lib/python2.7/site-packages/py2app/build_app.py", line 865, in _run
self.run_normal()
File "/usr/local/lib/python2.7/site-packages/py2app/build_app.py", line 959, in run_normal
self.create_binaries(py_files, pkgdirs, extensions, loader_files)
File "/usr/local/lib/python2.7/site-packages/py2app/build_app.py", line 1214, in create_binaries
platfiles = mm.run()
File "/usr/local/lib/python2.7/site-packages/macholib/MachOStandalone.py", line 105, in run
mm.run_file(fn)
File "/usr/local/lib/python2.7/site-packages/macholib/MachOGraph.py", line 84, in run_file
self.scan_node(m)
File "/usr/local/lib/python2.7/site-packages/macholib/MachOGraph.py", line 110, in scan_node
m = self.load_file(filename, caller=node)
File "/usr/local/lib/python2.7/site-packages/macholib/MachOGraph.py", line 93, in load_file
newname = self.locate(name, loader=caller)
File "/usr/local/lib/python2.7/site-packages/macholib/MachOStandalone.py", line 23, in locate
newname = super(FilteredMachOGraph, self).locate(filename, loader)
File "/usr/local/lib/python2.7/site-packages/macholib/MachOGraph.py", line 49, in locate
loader=loader.filename)
TypeError: dyld_find() got an unexpected keyword argument 'loader'
为什么会这样?我花了最后几个小时试图部署.没有运气py2app,cx_freeze等.
解决方法:
这是一个解决方法:编辑文件MachOGraph.py,在你的情况下位于那里:
/usr/local/lib/python2.7/site-packages/macholib/MachOGraph.py
搜索术语loader = loader.filename)并将其替换为loader_path = loader.filename)
积分由David Goldenberg在bitbucket.org上发布. https://bitbucket.org/ronaldoussoren/py2app/issues/137/py2app-problems-using-enthought-python
标签:python,py2app 来源: https://codeday.me/bug/20190628/1320218.html