我想尝试使用 Python 开发 Cocoa 应用程序。我是 Mac 新手,我需要一些帮助来了解它是如何工作的。
首先我发现我需要安装py2app和py2objc。我使用了这里记录的 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?不幸的是,我还没有找到我之前发布的错误解决方案。
- 据我了解有两种蟒蛇。一个我安装到 Applications 文件夹(IDLE、启动器)中,另一个是 OS 提供的当前 Python 版本。你能描述一下区别吗?
- 如何选择 Mac OS 使用的当前 Python 版本?/Library/Frameworks/Python.framework 中的当前文件夹是什么?
可能看起来很混乱,但这是我的第一步!:) 谢谢