Cryptography failed to install - Upstream issue - Need changes to script
- Dominant language
- Python
- Stars
- 8
- Forks
- 10
- PR merge metrics
- No merged PRs in 30d
Description
Issue: Easy Install
This is the second time I am getting this issue, First time we solved it with rustup from snap which was day before yesterday and now I am trying to install a new server and facing the exact same issue. First was local server and second is cloud server which is our regular vps.
**Do the checklist before filing an issue:**
- [X] Did you retain the logfile (path of logfile is shared while the script is run)? We definitely **need** the logfile to debug any easy install related issues.
- [ ] Is this something you can debug and fix? Send a pull request! Bug fixes and documentation fixes are welcome
Distro Details:
1. `Linux XXX.contaboserver.net 4.15.0-135-generic frappe/bench#139-Ubuntu SMP Mon Jan 18 17:38:24 UTC 2021 x86_64 x86_64 x86_64 GNU/Linux`
```
DISTRIB_ID=Ubuntu
DISTRIB_RELEASE=18.04
DISTRIB_CODENAME=bionic
DISTRIB_DESCRIPTION="Ubuntu 18.04.5 LTS"
NAME="Ubuntu"
VERSION="18.04.5 LTS (Bionic Beaver)"
ID=ubuntu
ID_LIKE=debian
PRETTY_NAME="Ubuntu 18.04.5 LTS"
VERSION_ID="18.04"
HOME_URL="https://www.ubuntu.com/"
SUPPORT_URL="https://help.ubuntu.com/"
BUG_REPORT_URL="https://bugs.launchpad.net/ubuntu/"
PRIVACY_POLICY_URL="https://www.ubuntu.com/legal/terms-and-policies/privacy-policy"
VERSION_CODENAME=bionic
UBUNTU_CODENAME=bionic
```
**Command Run **
`sudo python3 install.py --production --version 11 --user {username}`
```
curl already installed!
wget already installed!
git already installed!
Installing pip3...
pip3 installed!
Command "python setup.py egg_info" failed with error code 1 in /tmp/pip-build-mkc4za5g/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.
```
```
=============================DEBUG ASSISTANCE=============================
error: Can not find Rust compiler
----------------------------------------
Can't rollback cryptography, nothing uninstalled.
Command "/usr/bin/python3 -u -c "import setuptools, tokenize;__file__='/tmp/pip-build-arr9bj8n/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-tdc_7_z2-record/install-record.txt --single-version-externally-managed --compile" failed with error code 1 in /tmp/pip-build-arr9bj8n/cryptography/
```
Log File Output:
```
Processing triggers for man-db (2.8.3-2ubuntu0.1) ...
Collecting setuptools
Downloading https://files.pythonhosted.org/packages/15/0e/255e3d57965f318973e417d5b7034223f1223de500d91b945ddfaef42a37/setuptools-53.0.0-py3-none-any.whl (784kB)
Collecting wheel
Downloading https://files.pythonhosted.org/packages/65/63/39d04c74222770ed1589c0eaba06c05891801219272420b40311cd60c880/wheel-0.36.2-py2.py3-none-any.whl
Collecting cryptography
Downloading https://files.pythonhosted.org/packages/f8/04/51dc8a4ccb37b69a4e165a94837f70653b0b6ca49a6346361062b1f6bb09/cryptography-3.4.3.tar.gz (545kB)
Complete output from command python setup.py egg_info:
=============================DEBUG ASSISTANCE==========================
If you are seeing an error here please try the following to
successfully install cryptography:
Upgrade to the latest pip and try again. This will fix errors for most
users. See: https://pip.pypa.io/en/stable/installing/#upgrading-pip
=============================DEBUG ASSISTANCE==========================
Traceback (most recent call last):
File "", line 1, in
File "/tmp/pip-build-mkc4za5g/cryptography/setup.py", line 14, in
from setuptools_rust import RustExtension
ModuleNotFoundError: No module named 'setuptools_rust'
----------------------------------------
Install script run at 21:02 on 2021-02-09
```
Solution:
New cryptohraphy needs `setuptools_rust` instead of `setuptools`
Install rustup using snap and then install cryptography as cryptography installation fails
```
sudo apt-get install build-essential libssl-dev libffi-dev cargo
sudo apt install snapd
sudo snap install rustup --classic
sudo rustup default stable
```
Then continue the easy install script. This had worked the first time but this is just a work around, not an actual fix.
Contributor guide
No contributing guide indexed for this repository
Research direction
Start with install.py, especially install_prerequisites around line 174, and review the logged pip failure for cryptography 3.4.3 on Ubuntu 18.04. Reproduce the command from the issue and verify that the Easy Install script completes without requiring the reported manual workaround.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python
- Domain
- devops
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 25/100