首页 文章

Py2app与原生Python 2.6

提问于
浏览
0

我有一个python应用程序主要依赖于matplotlib,tkinter,numpy和scipy我一直在分发多个操作系统 . 我在python 2.6的python.org版本之上构建这些 . 对于mac,我在过去使用py2app和pyinstaller取得了很好的成功,可以构建我的应用程序的独立版本 . 然而,最近,我已经包含了需要patsy,pandas和igraph的功能,并且必须移动到python 2.6的mac分布式版本才能使igraph工作 . 一切正常,在Mac上为我的操作系统构建我的软件的py2app版本(10.6)但是当我在10.8上运行时遇到以下错误:

Traceback (most recent call last):
 File "UI.pyc", line 603 createHeatMap
 File "clustering.pyc", line 31, in <module>
 File "mpl_toolkits/__init__.pyc", line 2, in <module>
 File "/System/Library/Frameworks/Python.framework/Versions/2.6/Extras/lib/python/pkg_resources.py", line 698, in <module>
 File "/System/Library/Frameworks/Python.framework/Versions/2.6/Extras/lib/python/pkg_resources.py", line 701, in Environment
 File "/System/Library/Frameworks/Python.framework/Versions/2.6/Extras/lib/python/pkg_resources.py", line 96, in get_supported_platform
 File "/System/Library/Frameworks/Python.framework/Versions/2.6/Extras/lib/python/pkg_resources.py", line 222, in get_build_platform
 File "/System/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/distutils/util.py", line 98, in get_platform
 File "/System/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/distutils/sysconfig.py", line 537, in get_config_vars
 File "/System/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/distutils/sysconfig.py", line 405, in _init_posix
DistutilsPlatformError: invalid Python installation: unable to open /user/include/python2.6/pyconfig.h (No such file or directory)

通过将文件pyconfig.h保存到目标计算机上的指定位置(不存在于10.8但存在于10.6中)来解决此问题,这使我的应用程序可以正常工作 . 在我的py2app pacakge目录中,在“Contents / Resources”下面有一个指向“include”目录的sym-link,它指向:/System/Library/Frameworks/Python.framework/Versions/2.6/include/python2.6/pyconfig . H . 如果我将pyconfig.h文件作为附加资源包含在我的py2app安装文件中,它也会将其包含在包中,但仍然无法识别 .

任何人都可以建议一个好的工作,这不需要我使用python.org版本的python(我有可怕的运气得到igraph与此工作) .

谢谢...

1 回答

相关问题