以下是在我输入 python setup.py py2app 后出现的错误。我在Mac上。我花了几个小时阅读教程,确保 py2app 和 pyapplet 都已设置,并且按照教程进行操作,我不知道出了什么问题。这是错误:
running py2app
Traceback (most recent call last):
File "setup.py", line 18, in <module>
setup_requires=['py2app'],
File "/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/distutils/core.py", line 152, in setup
dist.run_commands()
File "/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/distutils/dist.py", line 975, in run_commands
self.run_command(cmd)
File "/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/distutils/dist.py", line 995, in run_command
cmd_obj.run()
File "/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/site-packages/py2app-0.7.3-py2.6.egg/py2app/build_app.py", line 502, in run
if sysconfig.get_config_var('PYTHONFRAMEWORK') is None:
AttributeError: 'NoneType' object has no attribute 'get_config_var'
这是我的 setup.py
"""
This is a setup.py script generated by py2applet
Usage:
python setup.py py2app
"""
from setuptools import setup
APP = ['kradio.py']
DATA_FILES = []
OPTIONS = {'argv_emulation': True}
setup(
app=APP,
data_files=DATA_FILES,
options={'py2app': OPTIONS},
setup_requires=['py2app'],
)
程序和安装程序都位于用户目录中。