17

我正在尝试使用 Python 2.7.3 在Ubuntu 10.04 (Lucid Lynx) 上安装 pycrypto2.6。

我遇到以下错误:

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 `/home/pratibha/Desktop/pycrypto-2.6':
configure: error: no acceptable C compiler found in $PATH
See `config.log' for more details
Traceback (most recent call last):
File "setup.py", line 456, in <module>
core.setup(**kw)
File "/usr/local/lib/python2.7/distutils/core.py", line 152, in setup
dist.run_commands()
File "/usr/local/lib/python2.7/distutils/dist.py", line 953, in run_commands
self.run_command(cmd)
File "/usr/local/lib/python2.7/distutils/dist.py", line 972, in run_command
cmd_obj.run()
File "/usr/local/lib/python2.7/distutils/command/build.py", line 127, in run
self.run_command(cmd_name)
File "/usr/local/lib/python2.7/distutils/cmd.py", line 326, in run_command
self.distribution.run_command(command)
File "/usr/local/lib/python2.7/distutils/dist.py", line 972, in run_command
cmd_obj.run()
File "setup.py", line 251, in run
self.run_command(cmd_name)
File "/usr/local/lib/python2.7/distutils/cmd.py", line 326, in run_command
self.distribution.run_command(command)
File "/usr/local/lib/python2.7/distutils/dist.py", line 972, in run_command
cmd_obj.run()
File "setup.py", line 278, in run
raise RuntimeError("autoconf error")
RuntimeError: autoconf error

我检查了软件中心,并且在我的系统上安装了 GCC,但是“which gcc”命令没有返回任何路径。

我通过创建符号链接得到它:

ln -s /usr/bin/gcc-4.4 /usr/bin/gcc
4

3 回答 3

20

在共享主机(Webfaction)上安装 pycrypto 时,我遇到了类似的错误消息。解决方案是在安装时更改临时目录:

TMPDIR=~/tmp pip install pycrypto
于 2015-03-27T10:52:24.663 回答
20

我有一个类似的问题,但就我而言,事实证明我根本没有gcc安装。

所以一个简单sudo apt-get install gcc的伎俩。

如果您已安装它,但which gcc没有返回任何路径,请转到/usr/bin/并查找gcc. 然后创建一个符号链接,如下所示:

ln -s /usr/bin/gcc-<version-number> /usr/bin/gcc

当然,您替换<version-number>为适当的版本号。

于 2013-01-18T15:42:08.540 回答
10

我遇到了同样的问题,尝试安装 gcc 的上述步骤没有帮助。

一旦我安装了 python-dev 包,一切都编译得很好。

sudo apt-get install python-dev

于 2014-02-27T01:44:55.193 回答