Failed building wheel for cryptography

Failed building wheel for cryptography
Can’t roll back cryptography; was not uninstalled
Command “/usr/bin/python3 -u -c “import setuptools, tokenize;file=‘/tmp/pip-install-4lcfkvzg/cryptography/setup.py’;f=getattr(tokenize, ‘open’, open)(file);code=f.read().replace(‘\r\n’, ‘\n’);f.close();exec(compile(code, file, ‘exec’))” install --record /tmp/pip-record-vzz8jocb/install-record.txt --single-version-externally-managed --compile” failed with error code 1 in /tmp/pip-install-4lcfkvzg/cryptography/
Traceback (most recent call last):
File “install.py”, line 484, in
install_prerequisites()
File “install.py”, line 174, in install_prerequisites
‘python3’: “sudo -H python3 -m pip install --upgrade setuptools wheel cryptography ansible~=2.8.15 pip”
File “install.py”, line 141, in run_os_command
returncode = subprocess.check_call(command, shell=True, stdout=log_stream, stderr=sys.stderr)
File “/usr/lib/python3.7/subprocess.py”, line 347, in check_call
raise CalledProcessError(retcode, cmd)
subprocess.CalledProcessError: Command ‘sudo -H python3 -m pip install --upgrade setuptools wheel cryptography ansible~=2.8.15 pip’ returned non-zero exit status 1.

To solve this, upgrade your pip and rerun the install.py
python3 -m pip install --upgrade pip

Reference: Installation fail: Wrong pip version. · Issue #1119 · frappe/bench · GitHub

I have de same problem, it is not letting me install

any idea how to solve it? I have already tried updating pip, setuptools…

There’s a lot of discussion about this on the internet. It’s usually a version incompatibility, but the few times I’ve run into it it took a lot of debugging.

did you try the above command? what was the output?

yes i have tried

and its not working

Any solution of it?

Hey there, run this command as root to tell pip to upgrade itself

pip3 install --upgrade pip

Then go back to your frappe user and try to install again

@Jibril
Thanks but it’s not working. Im running VB ubuntu 18.04 >>
jc@erp:~$ pip3 install --upgrade pip
WARNING: pip is being invoked by an old script wrapper. This will fail in a future version of pip.
Please see ImportError in system pip wrappers after an upgrade · Issue #5599 · pypa/pip · GitHub for advice on fixing the underlying issue.
To avoid this problem you can invoke Python with ‘-m pip’ instead of running pip directly.
Defaulting to user installation because normal site-packages is not writeable
Requirement already satisfied: pip in ./.local/lib/python3.6/site-packages (21.0.1)

jc@erp:~$ sudo python3 install.py --production
[sudo] password for jc:
Logs are saved under /tmp/logs/easy-install__2021-02-16__03-20.log
curl already installed!
wget already installed!
git already installed!
pip3 already installed!
Command “python setup.py egg_info” failed with error code 1 in /tmp/pip-build-jo_qs_xq/cryptography/
Traceback (most recent call last):
File “install.py”, line 484, in
install_prerequisites()
File “install.py”, line 174, in install_prerequisites
‘python3’: “sudo -H python3 -m pip install --upgrade setuptools wheel cryptography ansible~=2.8.15 pip”
File “install.py”, line 141, in run_os_command
returncode = subprocess.check_call(command, shell=True, stdout=log_stream, stderr=sys.stderr)
File “/usr/lib/python3.6/subprocess.py”, line 311, in check_call
raise CalledProcessError(retcode, cmd)
subprocess.CalledProcessError: Command ‘sudo -H python3 -m pip install --upgrade setuptools wheel cryptography ansible~=2.8.15 pip’ returned non-zero exit status 1.

I use this and it’s working for me.

sudo pip3 install --upgrade pip setuptools wheel
sudo pip3 install minepy

2 Likes

Finally …
Done… :wink:

Hey, how did you solve this? I

switching to python 3.8 helped

bench migrate-env python3.8