I'm trying to install a Django project onto my OSX machine, which requires PyCrypto. I'm getting the following error:
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
I'd like to confirm that Pycrypto is in fact unmaintained.
Python Cryptography Toolkit (pycrypto) This is a collection of both secure hash functions (such as SHA256 and RIPEMD160), and various encryption algorithms (AES, DES, RSA, ElGamal, etc.). The package is structured to make adding new modules easy.
pycrypto has to compile some code due to legal restrictions on cryptography, so this is why the VC++ Build Tools had to be installed and the VS Developer Command Prompt had to be started. There's a small issue with the pycrypto source, so as a workaround we have to include the correct header by setting the environment variable CL.
Trying to build and install paramiko and pycrypto will fail with a variety of errors ranging from “autoconf error” to “ImportError: No module named Crypto” – if you encounter either of those errors it’s because Xcode’s command line tools are not installed yet. sudo easy_install ./ That’s it.
There's a small issue with the pycrypto source, so as a workaround we have to include the correct header by setting the environment variable CL. here try to change the file name crypto to Crypto with upper case C because they import it as Crypto in every package. Checked with Python 3.7 x64 on Windows 10 x64 Version 1803.
Checked with Visual Studio 2017. Start an elevated (!!!) VS Developer Command Prompt (Run As Admin via Right Click) pycrypto has to compile some code due to legal restrictions on cryptography, so this is why the VC++ Build Tools had to be installed and the VS Developer Command Prompt had to be started.
configure: error: no acceptable C compiler found in $PATH
This error is self-explanatory. Get a C compiler.
XCode should work.
If you're using Xcode 4.x on Lion, you'll need to jump through some extra hoops to get this to compile and install:
1) In Xcode, go Preferences > Downloads, and click on the "Install" button next to "Command Line Tools" to install the compiler needed by Python.
2) In my case, I had to create a temporary symbolic link from gcc to gcc-4.2 to get the pycrypto compiler to shut up. In a terminal window, su to get root access:
a) Ensure gcc is installed:
# which gcc
/usr/bin/gcc
b) Create the symbolic link:
# ln -s /usr/bin/gcc /usr/bin/gcc-4.2
3) cd into your pycrypto directory and build and install pycrpto:
# cd ~/Downloads/pycrypto-2.5
(or your version)# python setup.py build
# python setup.py install
4) Delete the symbolic link you made earlier:
# rm /usr/bin/gcc-4.2
If your process works like mine, you should have a functioning pycrypto installed on Lion.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With