Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

pycrypto on Ubuntu giving compiler error

I am trying to install pycrypto2.6 on Ubuntu 10.04 (Lucid Lynx) with Python 2.7.3.

I am encountering the following error:

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

I checked Software Centre, and I have GCC installed on my system, but the "which gcc" command is not returning any path.

I got it by creating the symbolic link:

ln -s /usr/bin/gcc-4.4 /usr/bin/gcc
like image 905
Pratibha Avatar asked Jul 24 '12 06:07

Pratibha


3 Answers

I had a similar problem, but in my case it turns out I didn't have gcc installed at all.

So a simple sudo apt-get install gcc did the trick.

If you have it installed, but which gcc doesn't return any path, then go to /usr/bin/ and look for gcc. Then create a symbolic link, like so:

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

where you replaced <version-number> with the appropriate version number, of course.

like image 116
Paul T. Avatar answered Nov 07 '22 05:11

Paul T.


I ran into a similar error message when installing pycrypto on a shared host (Webfaction). The solution was to change the temporary directory while installing:

TMPDIR=~/tmp pip install pycrypto
like image 37
seddonym Avatar answered Nov 07 '22 05:11

seddonym


I was having the same problem, and trying the above step of installing gcc did not help.

Once I installed the python-dev package, everything compiled perfectly.

sudo apt-get install python-dev

like image 10
IvanD Avatar answered Nov 07 '22 06:11

IvanD