Easy Install Fails on Ubuntu 18.04 .5 LTS

Logs are saved under /tmp/logs/easy-install__2021-04-17__05-43.log
Checking System Compatibility...
ubuntu 18 is compatible!
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-y7qjivke/cryptography/
Traceback (most recent call last):
  File "install.py", line 436, in <module>
    install_prerequisites()
  File "install.py", line 143, in install_prerequisites
    'python3': "sudo -H python3 -m pip install --upgrade setuptools cryptography ansible==2.8.5 pip"
  File "install.py", line 118, 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 cryptography ansible==2.8.5 pip' returned non-zero exit status 1.

Easy Install Log

Preparing to unpack .../06-python3-keyring_10.6.0-1_all.deb ...
Unpacking python3-keyring (10.6.0-1) ...
Selecting previously unselected package python3-keyrings.alt.
Preparing to unpack .../07-python3-keyrings.alt_3.0-1_all.deb ...
Unpacking python3-keyrings.alt (3.0-1) ...
Selecting previously unselected package python3-pip.
Preparing to unpack .../08-python3-pip_9.0.1-2.3~ubuntu1.18.04.4_all.deb ...
Unpacking python3-pip (9.0.1-2.3~ubuntu1.18.04.4) ...
Selecting previously unselected package python3-wheel.
Preparing to unpack .../09-python3-wheel_0.30.0-0.2_all.deb ...
Unpacking python3-wheel (0.30.0-0.2) ...
Selecting previously unselected package python3-xdg.
Preparing to unpack .../10-python3-xdg_0.25-4ubuntu1.1_all.deb ...
Unpacking python3-xdg (0.25-4ubuntu1.1) ...
Setting up python-pip-whl (9.0.1-2.3~ubuntu1.18.04.4) ...
Setting up python3-cffi-backend (1.11.5-1) ...
Setting up python3-crypto (2.6.1-8ubuntu2) ...
Setting up python3-xdg (0.25-4ubuntu1.1) ...
Setting up python3-keyrings.alt (3.0-1) ...
Setting up python3-wheel (0.30.0-0.2) ...
Setting up python3-asn1crypto (0.24.0-1) ...
Setting up python3-pip (9.0.1-2.3~ubuntu1.18.04.4) ...
Setting up python3-cryptography (2.1.4-1ubuntu1.4) ...
Setting up python3-secretstorage (2.3.1-2) ...
Setting up python3-keyring (10.6.0-1) ...
Processing triggers for man-db (2.8.3-2ubuntu0.1) ...
Collecting setuptools
  Downloading https://files.pythonhosted.org/packages/ae/42/2876a3a136f8bfa9bd703518441c8db78ff1eeaddf174baa85c083c1fd15/setuptools-56.0.0-py3-none-any.whl (784kB)
Collecting cryptography
  Downloading https://files.pythonhosted.org/packages/9b/77/461087a514d2e8ece1c975d8216bc03f7048e6090c5166bc34115afdaa53/cryptography-3.4.7.tar.gz (546kB)
    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 "<string>", line 1, in <module>
      File "/tmp/pip-build-y7qjivke/cryptography/setup.py", line 14, in <module>
        from setuptools_rust import RustExtension
    ModuleNotFoundError: No module named 'setuptools_rust'

that command itself exited with error as shown during easy install script, still i did separately

sudo -H python3 -m pip install --upgrade setuptools cryptography ansible==2.8.5 pip
[sudo] password for frappe: 
Collecting setuptools
  Using cached https://files.pythonhosted.org/packages/ae/42/2876a3a136f8bfa9bd703518441c8db78ff1eeaddf174baa85c083c1fd15/setuptools-56.0.0-py3-none-any.whl
Collecting cryptography
  Using cached https://files.pythonhosted.org/packages/9b/77/461087a514d2e8ece1c975d8216bc03f7048e6090c5166bc34115afdaa53/cryptography-3.4.7.tar.gz
    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 "<string>", line 1, in <module>
      File "/tmp/pip-build-jo_q00z2/cryptography/setup.py", line 14, in <module>
        from setuptools_rust import RustExtension
    ModuleNotFoundError: No module named 'setuptools_rust'
    
    ----------------------------------------
Command "python setup.py egg_info" failed with error code 1 in /tmp/pip-build-jo_q00z2/cryptography/ 

Meanwhile,

pip3 --version

pip 9.0.1 from /usr/lib/python3/dist-packages (python 3.6)
apt -y install git build-essential python3-setuptools python3-dev libffi-dev libssl-dev
wget https://bootstrap.pypa.io/get-pip.py
python3 get-pip.py
sudo pip3 install --upgrade pip setuptools wheel

thanks, but still same error , few more details

frappe@vmi563446:~$ alias pip=pip3
frappe@vmi563446:~$ pip --version
WARNING: pip is being invoked by an old script wrapper. This will fail in a future version of pip.
Please see https://github.com/pypa/pip/issues/5599 for advice on fixing the underlying issue.
To avoid this problem you can invoke Python with '-m pip' instead of running pip directly.
pip 21.0.1 from /home/frappe/.local/lib/python3.6/site-packages/pip (python 3.6)
frappe@vmi563446:~$ sudo -H python3 install.py --production --user frappe --mysql-root-password Jaie^bdr59y --admin-password 123 
Logs are saved under /tmp/logs/easy-install__2021-04-17__06-26.log
Checking System Compatibility...
ubuntu 18 is compatible!
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-jub7l7ec/cryptography/
Traceback (most recent call last):
  File "install.py", line 436, in <module>
    install_prerequisites()
  File "install.py", line 143, in install_prerequisites
    'python3': "sudo -H python3 -m pip install --upgrade setuptools cryptography ansible==2.8.5 pip"
  File "install.py", line 118, 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 cryptography ansible==2.8.5 pip' returned non-zero exit status 1.
frappe@vmi563446:~$ sudo -H python3 -m pip install --upgrade setuptools cryptography ansible==2.8.5 pip
Requirement already up-to-date: setuptools in /usr/local/lib/python3.6/dist-packages
Collecting cryptography
  Using cached https://files.pythonhosted.org/packages/9b/77/461087a514d2e8ece1c975d8216bc03f7048e6090c5166bc34115afdaa53/cryptography-3.4.7.tar.gz
    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 "<string>", line 1, in <module>
      File "/tmp/pip-build-h80r7vnt/cryptography/setup.py", line 14, in <module>
        from setuptools_rust import RustExtension
    ModuleNotFoundError: No module named 'setuptools_rust'
    
    ----------------------------------------
Command "python setup.py egg_info" failed with error code 1 in /tmp/pip-build-h80r7vnt/cryptography/

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

this is the new issue reported here…
https://github.com/frappe/bench/issues/1117

unfortunately , that too didn’t worked ! .
still same error

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.