什么是最好的方式来安装Django在OS X 10.7狮子? [英] What is the best way to setup Django on os X 10.7 Lion?

查看:134
本文介绍了什么是最好的方式来安装Django在OS X 10.7狮子?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述



我尝试使用默认安装的Python:

/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/



我通常使用一个名为easy_install的基于Python的包管理器。
Easy_install似乎找不到编译器。



编辑:当我试图安装MySQL-python时,我得到这个错误:

  $ sudo easy_install MySQL-python 
密码:
搜索MySQL-python
阅读http:// pypi .python.org / simple / MySQL-python /
阅读http://sourceforge.net/projects/mysql-python/
阅读http://sourceforge.net/projects/mysql-python
最佳匹配:MySQL-python 1.2.3
下载http://download.sourceforge.net/sourceforge/mysql-python/MySQL-python-1.2.3.tar.gz
处理MySQL- python-1.2.3.tar.gz
运行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
警告:没有找到匹配'MANIFEST'的文件
警告:没有找到匹配'ChangeLog'的文件
警告:没有找到匹配'GPL'的文件
无法执行llvm-gcc-4.2:没有这样的文件或目录
错误:安装脚本退出与错误:命令'llvm-gcc-4.2'失败退出状态1
pre>

错误:安装脚本退出时出错:退出状态1,命令llvm-gcc-4.2失败

显然,系统尝试使用相同的编译器来编译安装的Python框架。
由于某种原因,苹果不包括llvm-gcc-4.2。



Xcode 4.1使用GCC,但是Xcode 4.3似乎已经改变。 >
从我可以收集,苹果想使用Clang作为编译器对GCC。
所以我添加到.bash_profile:



cc = clang



我决定只重新编译Python铛,但首先,我需要安装readline。

失败:

  Wed Feb 22 16: 04:59〜/ Downloads / readline-6.2 
$ ./configure
检查构建系统类型... i386-apple-darwin11.3.0
检查主机系统类型... i386-apple -darwin11.3.0

开始配置readline-6.2 for i386-apple-darwin11.3.0

检查make set是否$(MAKE)... no
检查gcc ... no
检查cc ... no
检查cl.exe ... no
configure:error:in`/ Users / Bryan / Downloads / readline- 6.2':
configure:error:在$ PATH中找不到可接受的C编译器
更多细节参见`config.log'。

在Lion 10.7上安装Django最简单的方法是什么?

解决方案

您是否使用Xcode 4.3安装了命令行工具?默认情况下不安装它们。您可以通过在Xcode 4.3的首选项中转到下载窗格来安装它们。


I am setting up Python and Django on os X 10.7 from a virgin install and Xcode 4.3.

I tried using the default install of Python:
/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/

I normally use a Python based package manager called easy_install. Easy_install seems to not be able to find the compiler.

EDIT: When I tried to install MySQL-python I got this error:

$ 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

error: Setup script exited with error: command 'llvm-gcc-4.2' failed with exit status 1
Apparently, the system attempts to use the same compiler used to compile the installed Python framework. For some reason Apple didn't include llvm-gcc-4.2.

Xcode 4.1 used GCC, but with Xcode 4.3 that seems to have changed.
From what I can gather, Apple wants to use Clang as the compiler vs GCC. So I added to .bash_profile:

cc=clang

I decided I would just recompile Python with clang but first, I needed to install readline.
Fail:

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.

What the easiest way to install Django on Lion 10.7?

解决方案

Did you install the command-line tools with Xcode 4.3? They are not installed by default. You can install them by going to the Downloads pane in Xcode 4.3's preferences.

这篇关于什么是最好的方式来安装Django在OS X 10.7狮子?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆