我在os X 10.7上從virgin install和Xcode 4.3設置Python和Django。在os X 10.7 Lion上設置Django的最佳方式是什麼?
我嘗試使用默認安裝的Python:
/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/
我通常使用一個基於Python包經理叫easy_install的。 Easy_install似乎無法找到編譯器。
編輯:當我試圖安裝MySQL-python的我得到這個錯誤:
$ sudo easy_install MySQL-python
Password:
Searching for MySQL-python
Reading http://pypi.python.org/simple/MySQL-python/
Reading http://sourceforge.net/projects/mysql-python/
Reading http://sourceforge.net/projects/mysql-python
Best match: MySQL-python 1.2.3
Downloading http://download.sourceforge.net/sourceforge/mysql-python/MySQL-python-1.2.3.tar.gz
Processing MySQL-python-1.2.3.tar.gz
Running MySQL-python-1.2.3/setup.py -q bdist_egg --dist-dir /tmp/easy_install-P9H9WX/MySQL-python-1.2.3/egg-dist-tmp-rRTfZL
warning: no files found matching 'MANIFEST'
warning: no files found matching 'ChangeLog'
warning: no files found matching 'GPL'
unable to execute llvm-gcc-4.2: No such file or directory
error: Setup script exited with error: command 'llvm-gcc-4.2' failed with exit status 1
錯誤:安裝腳本退出,出現錯誤:命令 'LLVM-GCC-4.2' 失敗,退出狀態1
顯然,系統會嘗試使用相同的編譯器來編譯已安裝的Python框架。 由於某些原因,Apple不包括llvm-gcc-4.2。
Xcode 4.1使用海灣合作委員會,但與Xcode 4.3似乎已經改變。
從我能收集到的信息來看,Apple希望使用Clang作爲編譯器與GCC。 所以我加入到.bash_profile中:
CC =鐺
我決定我只想重新編譯的Python鏗鏘但首先,我需要安裝readline的。
失敗:
Wed Feb 22 16:04:59 ~/Downloads/readline-6.2
$ ./configure
checking build system type... i386-apple-darwin11.3.0
checking host system type... i386-apple-darwin11.3.0
Beginning configuration for readline-6.2 for i386-apple-darwin11.3.0
checking whether make sets $(MAKE)... no
checking for gcc... no
checking for cc... no
checking for cl.exe... no
configure: error: in `/Users/Bryan/Downloads/readline-6.2':
configure: error: no acceptable C compiler found in $PATH
See `config.log' for more details.
什麼對獅子10.7安裝Django的最簡單的方法?
從他們的網站上安裝一個Python包,不要自己編譯。 OSX上的默認python安裝似乎有一些自定義。我在Lion上運行python 2.7.2 + Django並沒有問題。 – Endophage 2012-02-22 21:41:36
你是如何安裝MySQLdb的? – BryanWheelock 2012-02-27 16:36:14
'pip安裝mysql-python'或'easy_install mysql-python'如果由於某種原因未安裝pip – Endophage 2012-02-27 20:31:00