gpt4 book ai didi

python - 在 os X 10.7 Lion 上设置 Django 的最佳方法是什么?

转载 作者:行者123 更新时间:2023-11-28 19:40:35 24 4
gpt4 key购买 nike

我正在通过原始安装和 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

错误:安装脚本因错误而退出:命令“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

我决定只用 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.

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

最佳答案

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

关于python - 在 os X 10.7 Lion 上设置 Django 的最佳方法是什么?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/9403453/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com