我想嘗試使用Python開發Cocoa應用程序。我是Mac新手,需要一些幫助來了解它的工作原理。理解Cocoa開發在Mac OS上安裝Python的概念
首先我發現我需要安裝py2app和py2objc。我使用easy_install作爲記錄here。安裝工具出現了一些錯誤,但最終安裝了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什麼?不幸的是,我沒有找到一個解決錯誤的方法,我之前發佈了 。按照我的理解, 有兩種python。一個我 安裝到應用程序文件夾 (IDLE,啓動器),另一個是 當前Python版本與 OS提供。你能描述一下 的區別嗎?
- 如何選擇 Mac OS使用的Python的當前版本 ? /Library/Frameworks/Python.framework中的Current 文件夾是什麼?
大概看起來很混亂,但這是我的第一步! :) 謝謝
看起來像一些包含文件無法找到。這意味着include-dir設置錯誤。看到這個問題如何指定包括目錄:http://stackoverflow.com/questions/4753127 丟失的包含文件居住'/ usr/include' – 2011-03-20 11:41:18