Reputation: 71
Please be gentle on me. I have searched the site, and I know there is another answer to this exact question, but the answers posted there aren't working for me.
I am trying to install pycrypto
, so that I can get paramiko
to work. Paramiko
is failing because of a missing pycrypto
module. I have tried using pip install pycrypto
which succeeds, but does not cure the problem.
I have tried installing a binary version of pycrypto
and that doesn't solve the problem.
Now I am trying to build pycrypto
. I have cygwin64
and mingw
installed on my machine. The approach that gets the farthest is
python setup.py build --compiler=mingw32
This gets to an error,
checking whether we are cross compiling... configure: error: in `/cygdrive/c/Python27/pycrypto-2.6.1':
configure: error: cannot run C compiled programs.
The other answer suggests removing spaces in the path. I have tried reducing the path to simply
c:\mingw;c:\python2.7;c:\cygwin64\bin
with no change to the result?
Does anyone have a fix they can point me to? Thank you. The overall goal is to get paramiko
to work. The paramiko
error is
ImportError: No module named Crypto.PublicKey
Upvotes: 7
Views: 6672
Reputation: 2800
In my case, the /tmp
mount point was mounted with the noexec
flag.
For windows with cygwin, I would check the mount point too, as well as dependencies such as the vcredist
packages required for python2 and python3, see also Errors while building/installing C module for Python 2.7.
Two solutions for linux:
e.g.:
sudo mount -o remount,rw,exec /tmp
e.g.:
mkdir -p ~/python/tmp
pip install --build ~/python/tmp pycrypto
Note: it's worth looking at the other answers:
autoconf
and python2-dev
or python3-dev
packages are installed.Upvotes: 7
Reputation: 60014
I had a similar problem:
pip install --upgrade subprocess32
failed with
configure: error: cannot run C compiled programs
on aws
after our admins tightened the settings and mounted tmpfs
with the noexec
option.
The solution was
TMPDIR=/var/tmp pip install --upgrade subprocess32
Upvotes: 5
Reputation: 813
I had the same error message when installing pycrypto (although nothing to do with paramiko). The solution for me was:
yum install autoconf
TMPDIR=/home/$USER/tmp
TMP=$TMPDIR
TEMP=$TMPDIR
export TMPDIR TMP TEMP
and then install again:
pip install pocrypto
Upvotes: 3
Reputation: 1996
I had this same problem in Chrubuntu 14.04, and solved it by first doing:
apt-get install python-dev
...to fix something to do with header files, and then:
pip install pycrypto
...to solve the actual problem with paramiko. However, then paramiko had a problem with something ecdsa, and 'pip install paramiko' said everything was already installed, no problem, so I did 'pip uninstall paramiko' followed by 'pip install paramiko', and now I can import paramiko in python without a problem.
There is probably a more elegant way to solve that last bit but this worked well enough for me.
Upvotes: 0