Bry*_*ock 2 python django clang osx-lion
我从原始安装和Xcode 4.3在os X 10.7上设置Python和Django.
我尝试使用Python的默认安装:
/ Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/
我通常使用一个名为easy_install的基于Python的包管理器.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
Run Code Online (Sandbox Code Playgroud)
错误:安装脚本退出并显示错误:命令'llvm-gcc-4.2'因退出状态1而失败
显然,系统尝试使用用于编译已安装的Python框架的相同编译器.出于某种原因,Apple没有包含llvm-gcc-4.2.
Xcode 4.1使用了GCC,但Xcode 4.3似乎已经改变了.
从我可以收集到的,Apple希望使用Clang作为编译器与GCC.所以我添加到了.bash_profile:
CC =铛
我决定用clang重新编译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.
Run Code Online (Sandbox Code Playgroud)
在Lion 10.7上安装Django的最简单方法是什么?