我正在尝试将Django项目安装到我的OSX机器上,这需要PyCrypto.我收到以下错误:
running install
running build
running build_py
running build_ext
running build_configure
checking for gcc... no
checking for cc... no
checking for cl.exe... no
configure: error: in `/Users/home/Documents/tmp/dlitz-pycrypto-d2170a4':
configure: error: no acceptable C compiler found in $PATH
See `config.log' for more details
Traceback (most recent call last):
File "setup.py", line 486, in <module>
core.setup(**kw)
File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/distutils/core.py", line 152, in setup
File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/distutils/dist.py", line 953, in run_commands
File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/distutils/dist.py", line 972, in run_command
File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/distutils/command/install.py", line 573, in run
File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/distutils/cmd.py", line 326, in run_command
File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/distutils/dist.py", line 972, in run_command
File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/distutils/command/build.py", line 127, in run
File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/distutils/cmd.py", line 326, in run_command
File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/distutils/dist.py", line 972, in run_command
File "setup.py", line 292, in run
self.run_command(cmd_name)
File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/distutils/cmd.py", line 326, in run_command
File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/distutils/dist.py", line 972, in run_command
File "setup.py", line 319, in run
raise RuntimeError("autoconf error")
RuntimeError: autoconf error
Run Code Online (Sandbox Code Playgroud)
Ble*_*der 10
configure: error: no acceptable C compiler found in $PATH
Run Code Online (Sandbox Code Playgroud)
此错误不言自明.获取C编译器.
XCode应该工作.
如果你在Lion上使用Xcode 4.x,你需要跳过一些额外的箍来编译和安装:
1)在Xcode中,转到Preferences> Downloads,然后单击"Command Line Tools"旁边的"Install"按钮,安装Python所需的编译器.
2)在我的情况下,我必须创建一个从gcc到gcc-4.2的临时符号链接,以使pycrypto编译器闭嘴.在终端窗口中,su获取root访问权限:
a)确保安装了gcc:
# which gcc
/usr/bin/gcc
b)创建符号链接:
# ln -s /usr/bin/gcc /usr/bin/gcc-4.2
3)cd进入你的pycrypto目录并构建并安装pycrpto:
# cd ~/Downloads/pycrypto-2.5 (或你的版本)
# python setup.py build
# python setup.py install
4)删除您之前创建的符号链接:
# rm /usr/bin/gcc-4.2
如果你的过程像我的一样,你应该在Lion上安装一个功能正常的pycrypto.
| 归档时间: |
|
| 查看次数: |
15450 次 |
| 最近记录: |