我在macOS Sierra 10.12.5上创建了一个wxpython GUI应用程序。我正在尝试使用py2app创建一个独立的应用程序。我的python安装:
Python 2.7.13 (Anaconda intel python, virtual environment).
py2app 0.14
这是我的设置python代码:
#!/usr/bin/env python
"""
$ python build_CtAnnotator.py - script for building CtAnnotator
Usage:
% python build_CtAnnotator.py py2app
"""
from setuptools import setup
import sys
# from distutils.core import setup
sys.setrecursionlimit(20000)
APP = ['CtAnnotator.py']
OPTIONS = {'site_packages': True,
'argv_emulation': True,
'alias': False,
'plist': {'PyRuntimeLocations': ['/opt/anaconda2/envs/intelpython2/lib/libpython2.7.dylib']}
}
setup(app=APP,
options={'py2app': OPTIONS},
setup_requires=['py2app'],
)
这是我在py2app输出的许多行之后得到的错误。
WARNING: Mach-O header in '/Volumes/<...>/Repository/CtAnnotation/dist/CtAnnotator.app/Contents/Resources/lib/python2.7/lib-dynload/numba/_dispatcher.so' may be too large to relocate
Traceback (most recent call last):
File "build_CtAnnotator.py", line 24, in <module>
setup_requires=['py2app'],
File "/opt/anaconda2/envs/intelpython2/lib/python2.7/distutils/core.py", line 151, in setup
dist.run_commands()
File "/opt/anaconda2/envs/intelpython2/lib/python2.7/distutils/dist.py", line 953, in run_commands
self.run_command(cmd)
File "/opt/anaconda2/envs/intelpython2/lib/python2.7/distutils/dist.py", line 972, in run_command
cmd_obj.run()
File "/opt/anaconda2/envs/intelpython2/lib/python2.7/site-packages/py2app/build_app.py", line 825, in run
self._run()
File "/opt/anaconda2/envs/intelpython2/lib/python2.7/site-packages/py2app/build_app.py", line 1040, in _run
self.run_normal()
File "/opt/anaconda2/envs/intelpython2/lib/python2.7/site-packages/py2app/build_app.py", line 1152, in run_normal
self.create_binaries(py_files, pkgdirs, extensions, loader_files)
File "/opt/anaconda2/envs/intelpython2/lib/python2.7/site-packages/py2app/build_app.py", line 1512, in create_binaries
platfiles = mm.run()
File "/opt/anaconda2/envs/intelpython2/lib/python2.7/site-packages/macholib/MachOStandalone.py", line 146, in run
node.write(f)
File "/opt/anaconda2/envs/intelpython2/lib/python2.7/site-packages/macholib/MachO.py", line 133, in write
header.write(f)
File "/opt/anaconda2/envs/intelpython2/lib/python2.7/site-packages/macholib/MachO.py", line 343, in write
self.synchronize_size()
File "/opt/anaconda2/envs/intelpython2/lib/python2.7/site-packages/macholib/MachO.py", line 333, in synchronize_size
self.parent.filename, self.total_size + self.sizediff, self.low_offset, self.sizediff))
ValueError: New Mach-O header is too large to relocate in '/Volumes/<...>/Repository/CtAnnotation/dist/CtAnnotator.app/Contents/Resources/lib/python2.7/lib-dynload/numba/_dispatcher.so' (new size=1752L, max size=1744L, delta=24L)