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
3
  • 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
    Commented Jul 24, 2012 at 6: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. Commented May 14, 2016 at 2: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 worked. Yay security by obscurity.
    – Bob Stein
    Commented Nov 6, 2017 at 22:38

3 Answers 3

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.

2
  • $ which gcc /usr/bin/gcc And still not working.
    – zgoda
    Commented Dec 29, 2015 at 8:45
  • > So a simple sudo apt-get install gcc did the trick. That worked for me
    – jward01
    Commented Sep 10, 2017 at 17:09
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
5
  • 2
    Thanks, this answer helped me with with a box I was trying to pip install paramiko that had noexec for /tmp Commented Aug 3, 2015 at 19:37
  • 2
    Unfortunately this did not help, still getting the above error.
    – zgoda
    Commented Dec 29, 2015 at 8:47
  • This is a wrong solution for the original problem. Helps in another situation.
    – loop
    Commented Mar 10, 2016 at 3:07
  • 1
    I had this same problem on a shared Webfaction server, Centos 7. This solution worked perfectly, thanks. Commented Nov 1, 2016 at 1:50
  • 1
    mkdir ~/tmp and then it worked for me (duh), on CentOS.
    – Bob Stein
    Commented Nov 6, 2017 at 22:37
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

1
  • This works for me, ensure gcc AND python-dev are installed
    – JVercout
    Commented Apr 14, 2016 at 12:13

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.