How I solved "Failed cleaning build dir for cryptography"
(I came here from google to result for this error.)
note: using a virtualenv
my file /etc/apt/sources.list
wasn't correctly configured for my debian 8.
I wanted to install paramiko. paramiko needs cryptography.
I got these errors:
first with pip install cryptography
:
(...)
----------------------------------------
Failed cleaning build dir for cryptography
Failed to build cryptography
(...)
----------------------------------------
Command "/home/myuser/pyenvs/testo/bin/python -u -c "import setuptools, tokenize;__file__='/tmp/pip-build-HXWKAO/cryptography/setup.py';exec(compile(getattr(tokenize, 'open', open)(__file__).read().replace('\r\n', '\n'), __file__, 'exec'))" install --record /tmp/pip-WjqY6V-record/install-record.txt --single-version-externally-managed --compile --install-headers /home/myuser/pyenvs/testo/include/site/python2.7/cryptography" failed with error code 1 in /tmp/pip-build-HXWKAO/cryptography/
and then with sudo apt-get install build-essential
:
Reading package lists... Done
Building dependency tree
Reading state information... Done
Some packages could not be installed. This may mean that you have
requested an impossible situation or if you are using the unstable
distribution that some required packages have not yet been created
or been moved out of Incoming.
The following information may help to resolve the situation:
The following packages have unmet dependencies:
build-essential : Depends: libc6-dev but it is not going to be installed > or
libc-dev
Depends: gcc (>= 4:4.4.3) but it is not going to be installed
Depends: g++ (>= 4:4.4.3) but it is not going to be installed
E: Unable to correct problems, you have held broken packages.
(Not exactly the same errors as OP but I'm here to help eventually)
After testing almost every command from every posts I end up going on
https://wiki.debian.org/SourcesList
and copy pasted my adequate config in the file /etc/apt/sources.list
then:
sudo aptitude update
and then
sudo apt-get install build-essential libssl-dev libffi-dev python-dev
and then
pip install cryptography
hth