17

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
Peter Mortensen
  • 30,738
  • 21
  • 105
  • 131
Pratibha
  • 1,730
  • 7
  • 27
  • 46
  • 2
    Hello pratibha, please don't add "[solved]" to your question title, this isn't how this site works. Post your answer as an answer (you'll be able to do that in a while). If you already know the answer when posting, there's a button for that in the question editor. – Mat Jul 24 '12 at 06:45
  • You shouldn't have to create that symlink yourself. Installing the `gcc` package (which as I recall is pre-installed) should have created the symlink for you. – Keith Thompson May 14 '16 at 02:51
  • I got past the gcc part, but on `checking whether we are cross compiling` I got `configure: error: cannot run C compiled programs. If you meant to cross compile, use '--host'. See 'config.log' for more details` Never did find config.log. Anyway the [TMPDIR answer](https://stackoverflow.com/a/29298978/673991) worked. Yay security by obscurity. – Bob Stein Nov 06 '17 at 22:38

3 Answers3

20

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.

Paul T.
  • 714
  • 1
  • 9
  • 20
20

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
seddonym
  • 16,304
  • 6
  • 66
  • 71
10

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

IvanD
  • 7,971
  • 4
  • 35
  • 33