【发布时间】:2011-03-20 10:32:54
【问题描述】:
我想尝试使用 Python 开发 Cocoa 应用程序。我是 Mac 新手,需要一些帮助来了解它的工作原理。
首先我发现我需要安装py2app和py2objc。我使用了here 记录的easy_install。安装工具有一些错误,但最终安装了 py2app。然后我启动“easy_install pyobjc==2.2”并以许多错误结束:
Processing pyobjc-2.2-py2.7.egg
...
Running pyobjc-framework-SystemConfiguration-2.2/setup.py -q bdist_egg --dist-dir /tmp/easy_install-ipMzFU/pyobjc-framework-SystemConfiguration-2.2/egg-dist-tmp-odfVol
In file included from Modules/_manual.m:1:
/Library/Frameworks/Python.framework/Versions/2.7/include/python2.7/Python.h:19:20: error: limits.h: No such file or directory
/Library/Frameworks/Python.framework/Versions/2.7/include/python2.7/Python.h:22:2: error: #error "Something's broken. UCHAR_MAX should be defined in limits.h."
/Library/Frameworks/Python.framework/Versions/2.7/include/python2.7/Python.h:26:2: error: #error "Python's source code assumes C's unsigned char is an 8-bit type."
/Library/Frameworks/Python.framework/Versions/2.7/include/python2.7/Python.h:33:19: error: stdio.h: No such file or directory
/Library/Frameworks/Python.framework/Versions/2.7/include/python2.7/Python.h:35:5: error: #error "Python.h requires that stdio.h define NULL."
/Library/Frameworks/Python.framework/Versions/2.7/include/python2.7/Python.h:38:20: error: string.h: No such file or directory
/Library/Frameworks/Python.framework/Versions/2.7/include/python2.7/Python.h:40:19: error: errno.h: No such file or directory
/Library/Frameworks/Python.framework/Versions/2.7/include/python2.7/Python.h:42:20: error: stdlib.h: No such file or directory
/Library/Frameworks/Python.framework/Versions/2.7/include/python2.7/Python.h:44:20: error: unistd.h: No such file or directory
/Library/Frameworks/Python.framework/Versions/2.7/include/python2.7/Python.h:56:20: error: assert.h: No such file or directory
...
etc
我的问题:
- 我需要做些什么来安装 py2objc?不幸的是,我没有 找到了错误的解决方案,我 之前发过。
- 据我了解 有两种蟒蛇。一个我 安装到应用程序文件夹 (IDLE,启动器),另一个是 当前提供的 Python 版本 操作系统。你能描述一下吗 区别?
- 如何选择 当前使用的 Python 版本 苹果系统?什么是电流 文件夹在 /Library/Frameworks/Python.framework?
可能看起来很混乱,但这是我的第一步! :) 谢谢
【问题讨论】:
-
似乎找不到某些包含文件。这意味着包含目录设置错误。请参阅有关如何指定包含目录的问题:stackoverflow.com/questions/4753127 The missing include files live in
/usr/include
标签: python osx-snow-leopard cocoa-bindings py2app