Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

No module named 'setuptools_rust' with cryptography==3.4 #5753

Closed
freedge opened this issue Feb 7, 2021 · 23 comments
Closed

No module named 'setuptools_rust' with cryptography==3.4 #5753

freedge opened this issue Feb 7, 2021 · 23 comments

Comments

@freedge
Copy link

freedge commented Feb 7, 2021

EDIT: tl;dr: run "pip install --upgrade pip". You don't need to install Rust! Use --prefer-binary to make sure you're not rebuilding from sources.

$ python --version
Python 3.6.8
$ pip install cryptography
Collecting cryptography
  Downloading https://files.pythonhosted.org/packages/ea/d8/2afd2890fe451a3c109d2bdb6bc4ded55ec43059e524344d5e0004e36412/cryptography-3.4.tar.gz (544kB)
    100% |████████████████████████████████| 552kB 2.1MB/s
    Complete output from command python setup.py egg_info:
    Traceback (most recent call last):
      File "<string>", line 1, in <module>
      File "/tmp/pip-build-zb4wktwf/cryptography/setup.py", line 13, in <module>
        from setuptools_rust import RustExtension
    ModuleNotFoundError: No module named 'setuptools_rust'

"cryptography<3.4"
works just fine. Anything I am doing wrong ?

@alex
Copy link
Member

alex commented Feb 7, 2021

What version of pip are you using?

@freedge
Copy link
Author

freedge commented Feb 7, 2021

pip 9.0.3 :/ .. the default with centos7

upgrading to pip-21.0.1 fixes the problem :) thanks for the hint. If there is a way to report the error cleanly or force upgrade of pip that would be ideal. Closing anyway.

@freedge freedge closed this as completed Feb 7, 2021
@alex
Copy link
Member

alex commented Feb 7, 2021

I'll see about improving the error message, good idea.

@sbesson
Copy link

sbesson commented Feb 7, 2021

Thanks for the workaround. In addition to CentOS 7 mentioned in #5753 (comment), Ubuntu 18.04 currently ships Python 3.6/pip 9.0.1 by default so I suspect more installation workflows might be broken by the latest release unless they upgrade pip

Adding 👍 for ideally some mechanism detecting the pip version and minimally some message suggesting to upgrade pip.

@geraxe
Copy link

geraxe commented Feb 7, 2021

The next build failed with ci / cd. Began to check and saw that the version had changed for cryptography 3.3.2 -> 3.4
It runs in docker:19.03.1-dind

pip3 install docker-compose
...

   error: Can not find Rust compiler
   ----------------------------------------
   ERROR: Failed building wheel for cryptography

@alex
Copy link
Member

alex commented Feb 7, 2021

https://cryptography.io/en/latest/faq.html#installing-cryptography-fails-with-error-can-not-find-rust-compiler

@geraxe
Copy link

geraxe commented Feb 7, 2021

@dpage-edb
Copy link

apk add rust cargo

https://cryptography.io/en/latest/faq.html#installing-cryptography-fails-with-error-can-not-find-rust-compiler

You will need to change https://cryptography.io/en/latest/installation.html#alpine and add

apk add rust cargo

this work for me

Not me - I'm seeing this now:

#64 119.1        Running `rustc --crate-name pyo3_macros_backend --edition=2018 /root/.cargo/registry/src/github.com-1ecc6299db9ec823/pyo3-macros-backend-0.13.1/src/lib.rs --error-format=json --json=diagnostic-rendered-ansi --crate-type lib --emit=dep-info,metadata,link -C opt-level=3 -C metadata=1c47d36fb0c032da -C extra-filename=-1c47d36fb0c032da --out-dir /tmp/pip-install-hkvurqop/cryptography_b5ee5dd617e44d6cb4f77b54ca25070a/src/rust/target/release/deps -L dependency=/tmp/pip-install-hkvurqop/cryptography_b5ee5dd617e44d6cb4f77b54ca25070a/src/rust/target/release/deps --extern proc_macro2=/tmp/pip-install-hkvurqop/cryptography_b5ee5dd617e44d6cb4f77b54ca25070a/src/rust/target/release/deps/libproc_macro2-aa3871282eef8eab.rmeta --extern quote=/tmp/pip-install-hkvurqop/cryptography_b5ee5dd617e44d6cb4f77b54ca25070a/src/rust/target/release/deps/libquote-4a1344d16195b0c6.rmeta --extern syn=/tmp/pip-install-hkvurqop/cryptography_b5ee5dd617e44d6cb4f77b54ca25070a/src/rust/target/release/deps/libsyn-e836c33ca097f1fb.rmeta --cap-lints allow -C target-feature=-crt-static`
#64 119.1   error[E0658]: use of unstable library feature 'str_strip': newly added
#64 119.1      --> /root/.cargo/registry/src/github.com-1ecc6299db9ec823/pyo3-macros-backend-0.13.1/src/method.rs:144:18
#64 119.1       |
#64 119.1   144 |                 .strip_prefix(prefix)
#64 119.1       |                  ^^^^^^^^^^^^
#64 119.1       |
#64 119.1       = note: see issue #67302 <https://github.com/rust-lang/rust/issues/67302> for more information
#64 119.1   
#64 119.1   error: aborting due to previous error
#64 119.1   
#64 119.1   For more information about this error, try `rustc --explain E0658`.
#64 119.1   error: could not compile `pyo3-macros-backend`.

I'm swimming in build failures on various platforms caused by this at the moment, so any hints to save me time tracking them all down individually would be appreciated!

@tiran
Copy link
Contributor

tiran commented Feb 8, 2021

You need latest Alpine with Rust >= 1.45.

@dpage-edb
Copy link

Thanks - yeah, I needed to update to 3.13.

@stamak
Copy link

stamak commented Feb 8, 2021

the same with 3.4.1

Collecting cryptography>=2.0 (from SecretStorage>=3.2; sys_platform == "linux"->keyring>=15.1->twine==3.1.1->-r /root/project/requirements.txt (line 4))
  Downloading https://files.pythonhosted.org/packages/06/ed/cb79cc94ec58d9d92557238fc6c629cd6e07d72334d2de556aecc2211370/cryptography-3.4.1.tar.gz (544kB)
    Complete output from command python setup.py egg_info:
    Traceback (most recent call last):
      File "<string>", line 1, in <module>
      File "/tmp/pip-build-h9s3g3of/cryptography/setup.py", line 14, in <module>
        from setuptools_rust import RustExtension
    ModuleNotFoundError: No module named 'setuptools_rust'
    
            =============================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==========================
    
    
    ----------------------------------------
 (Command "python setup.py egg_info" failed with error code 1 in /tmp/pip-build-h9s3g3of/cryptography/
)

@tiran
Copy link
Contributor

tiran commented Feb 8, 2021

@stamak your pip version is too old.

@anhphamduy
Copy link

anhphamduy commented Feb 8, 2021

https://cryptography.io/en/latest/faq.html#installing-cryptography-fails-with-error-can-not-find-rust-compiler

You will need to change https://cryptography.io/en/latest/installation.html#alpine and add

apk add rust cargo

this work for me

What I've attempted (from python:3.7.5-alpine):

  1. pip install --upgrade pip setuptools
  2. sudo apk add gcc musl-dev python3-dev libffi-dev openssl-dev cargo - tried both libressl-dev and openssl-dev
  3. pip install cryptography --no-binary cryptography

The no Rust compiler is fixed but another one pops up.

running build_rust
  error: failed to parse lock file at: /tmp/pip-install-2ndtenxi/cryptography_82df3bbc5d0b43f79d507ec6c448c7ff/src/rust/Cargo.lock

  Caused by:
running build_ext
  generating cffi module 'build/temp.linux-x86_64-3.7/_padding.c'
  creating build/temp.linux-x86_64-3.7
  generating cffi module 'build/temp.linux-x86_64-3.7/_openssl.c'
  running build_rust
  error: failed to parse lock file at: /tmp/pip-install-2ndtenxi/cryptography_82df3bbc5d0b43f79d507ec6c448c7ff/src/rust/Cargo.lock

  Caused by:
    invalid serialized PackageId for key `package.dependencies`

      =============================DEBUG ASSISTANCE=============================
      If you are seeing a compilation error please try the following steps to
      successfully install cryptography:
      1) 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
      2) Read https://cryptography.io/en/latest/installation.html for specific
         instructions for your platform.
      3) Check our frequently asked questions for more information:
         https://cryptography.io/en/latest/faq.html
      4) Ensure you have a recent Rust toolchain installed.
      =============================DEBUG ASSISTANCE=============================

@jansmets
Copy link

jansmets commented Feb 8, 2021

Why is a new pip version required? For example, we use pip 9.0.1 and are installing paramiko==2.2.2 results in this issue. (paramiko sets a >= dependency) - please understand this has a significant impact.

@tiran
Copy link
Contributor

tiran commented Feb 8, 2021

Why is a new pip version required? For example, we use pip 9.0.1 and are installing paramiko==2.2.2 results in this issue. (paramiko sets a >= dependency) - please understand this has a significant impact.

You need a more recent pip version that supports pyproject.toml. IIRC pip 19.1.1 is the oldest version that works.

openstack-mirroring pushed a commit to openstack/tenks that referenced this issue Feb 8, 2021
Installing virtualbmc system-wide on CentOS 8 fails with:

    ModuleNotFoundError: No module named 'setuptools_rust'

This error appeared following the release of cryptography 3.4, which now
includes Rust code. It can be installed without Rust using a Python
wheel, but only with more recent pip than version 9.0.3 available as RPM
on CentOS 8. The cryptography bug report [1] recommends pip>=19.1.1.

Also ignore PyYAML when installing system-wide to avoid conflicts with
an existing RPM package installation.

[1] pyca/cryptography#5753

Change-Id: Ibd61e090611b3b7a7e0670c854362b512454bf3c
Story: 2008607
Task: 41788
openstack-mirroring pushed a commit to openstack/openstack that referenced this issue Feb 8, 2021
* Update tenks from branch 'master'
  to f34bb772a018d3ee3a2872358542ad51c22fc06e
  - Fix virtualbmc installation after release of cryptography 3.4
    
    Installing virtualbmc system-wide on CentOS 8 fails with:
    
        ModuleNotFoundError: No module named 'setuptools_rust'
    
    This error appeared following the release of cryptography 3.4, which now
    includes Rust code. It can be installed without Rust using a Python
    wheel, but only with more recent pip than version 9.0.3 available as RPM
    on CentOS 8. The cryptography bug report [1] recommends pip>=19.1.1.
    
    Also ignore PyYAML when installing system-wide to avoid conflicts with
    an existing RPM package installation.
    
    [1] pyca/cryptography#5753
    
    Change-Id: Ibd61e090611b3b7a7e0670c854362b512454bf3c
    Story: 2008607
    Task: 41788
@jvelonis
Copy link

jvelonis commented Feb 8, 2021

I'm using pip 21.0.1 (Python 3.8) on Ubuntu 18.04, and I'm still getting this error. I pinned cryptography to 3.3 for now.

@alex
Copy link
Member

alex commented Feb 8, 2021 via email

@jvelonis
Copy link

jvelonis commented Feb 8, 2021

My build uses Packer to create a container image based on the stock ubuntu:bionic image. It runs the following as root:

#!/bin/bash -ex

PYTHON_VERSION=3.8
export DEBIAN_FRONTEND=noninteractive

apt-get -y update
apt-get -y upgrade

apt-get install -y python${PYTHON_VERSION}
apt-get install -y python3-pip

# Make sure we have the latest pip (the package may be out of date)
python${PYTHON_VERSION} -m pip install -U pip
pip3 --version

apt-get install -y python${PYTHON_VERSION}-venv

mkdir /app
cp requirements.txt /app/requirements.txt

# Install the libraries in a virtual environment
cd /app
python${PYTHON_VERSION} -m venv .venv
source .venv/bin/activate
pip3 install -r /app/requirements.txt

@alex
Copy link
Member

alex commented Feb 8, 2021 via email

@jvelonis
Copy link

jvelonis commented Feb 8, 2021

That did it, thanks!

rhosqeauto pushed a commit to redhat-openstack/infrared that referenced this issue Feb 9, 2021
The cryptography package now requires pip 19+ which is
not available by default when using the distribution
packages.

pyca/cryptography#5753

To resolve this, we upgrade pip in the virtualenv if it
is not new enough. We maintain the pin on <20 to ensure
that it is usable in both python2 and python3 environments
and that it doesn't bring any new setuptools requirements
into the mix.

JIRA: RHOSINFRA-3877

Change-Id: I394877cd7ea856f37585986328c407665702ba98
openstack-mirroring pushed a commit to openstack-archive/tripleo-ansible that referenced this issue Feb 9, 2021
Molecule jobs[0] fails with below error:-

ModuleNotFoundError: No module named 'setuptools_rust'

This error appeared following the release of cryptography 3.4, which
now includes Rust code. It can be installed without Rust using a
Python wheel, but only with more recent pip than version 9.0.3
available as RPM on CentOS 8.

The cryptography bug report [1] recommends pip>=19.1.1.

[0] https://e99635be2c7386b5beda-3dea60a35fb0d38e41c535f13b48e895.ssl.cf1.rackcdn.com/773531/1/gate/tripleo-ansible-centos-8-molecule-tripleo_network_config/b1284cd/job-output.txt
[1] pyca/cryptography#5753
Related-Bug: #1915101

Change-Id: I3650a68640a0ec846be24014ebc6a71110b2f6f7
(cherry picked from commit f8a286c)
openstack-mirroring pushed a commit to openstack-archive/tripleo-ansible that referenced this issue Feb 9, 2021
Molecule jobs[0] fails with below error:-

ModuleNotFoundError: No module named 'setuptools_rust'

This error appeared following the release of cryptography 3.4, which
now includes Rust code. It can be installed without Rust using a
Python wheel, but only with more recent pip than version 9.0.3
available as RPM on CentOS 8.

The cryptography bug report [1] recommends pip>=19.1.1.

[0] https://e99635be2c7386b5beda-3dea60a35fb0d38e41c535f13b48e895.ssl.cf1.rackcdn.com/773531/1/gate/tripleo-ansible-centos-8-molecule-tripleo_network_config/b1284cd/job-output.txt
[1] pyca/cryptography#5753
Related-Bug: #1915101

Change-Id: I3650a68640a0ec846be24014ebc6a71110b2f6f7
(cherry picked from commit f8a286c)
openstack-mirroring pushed a commit to openstack/project-config that referenced this issue Feb 10, 2021
The base nodeset is still bionic, but at least cryptography fails
to build (after pyca/cryptography#5753).
Long-term is probably the long term fix (the base nodesets
are going to switch to focal at some point, and the override
could be then removed).

Change-Id: Ie339113d19fe93bb6f6aff14eab2783df22373a2
@alex alex unpinned this issue Feb 10, 2021
openstack-mirroring pushed a commit to openstack-archive/tripleo-validations that referenced this issue Feb 10, 2021
Molecule jobs[0] fails with below error:-

ModuleNotFoundError: No module named 'setuptools_rust'

This error appeared following the release of cryptography 3.4, which
now includes Rust code. It can be installed without Rust using a
Python wheel, but only with more recent pip than version 9.0.3
available as RPM on CentOS 8.

The cryptography bug report [1] recommends pip>=19.1.1.

[0] https://e99635be2c7386b5beda-3dea60a35fb0d38e41c535f13b48e895.ssl.cf1.rackcdn.com/773531/1/gate/tripleo-ansible-centos-8-molecule-tripleo_network_config/b1284cd/job-output.txt
[1] pyca/cryptography#5753
Related-Bug: #1915101

Change-Id: Ib5baad39dd7e43dff9046178c00b0f836dc18bae
openstack-mirroring pushed a commit to openstack/openstack that referenced this issue Feb 10, 2021
* Update tripleo-validations from branch 'master'
  to 0bf795117387177921b86f1e283fc16c204d96bf
  - Fix molecule jobs after release of cryptography3.4
    
    Molecule jobs[0] fails with below error:-
    
    ModuleNotFoundError: No module named 'setuptools_rust'
    
    This error appeared following the release of cryptography 3.4, which
    now includes Rust code. It can be installed without Rust using a
    Python wheel, but only with more recent pip than version 9.0.3
    available as RPM on CentOS 8.
    
    The cryptography bug report [1] recommends pip>=19.1.1.
    
    [0] https://e99635be2c7386b5beda-3dea60a35fb0d38e41c535f13b48e895.ssl.cf1.rackcdn.com/773531/1/gate/tripleo-ansible-centos-8-molecule-tripleo_network_config/b1284cd/job-output.txt
    [1] pyca/cryptography#5753
    Related-Bug: #1915101
    
    Change-Id: Ib5baad39dd7e43dff9046178c00b0f836dc18bae
giacomolanciano pushed a commit to giacomolanciano/kolla-ansible that referenced this issue Feb 11, 2021
Installing kolla-ansible system-wide on CentOS 8 fails with:

    ModuleNotFoundError: No module named 'setuptools_rust'

This error appeared following the release of cryptography 3.4, which now
includes Rust code. It can be installed without Rust using a Python
wheel, but only with more recent pip than version 9.0.3 available as RPM
on CentOS 8. The cryptography bug report [1] recommends pip>=19.1.1.

This change switches to using pip --user when installing kolla-ansible.

Also fixes an issue with ansible-lint which was failing on
etc/kolla/globals.yml due to a missing space before comments.

[1] pyca/cryptography#5753

Change-Id: Ifaf1948ed5d42eebaa62d7bad375bbfc12b134d5
Closes-Bug: #1915141
openstack-mirroring pushed a commit to openstack/openstack that referenced this issue Feb 11, 2021
* Update kolla-ansible from branch 'master'
  to 3dd6834a618d3ac83a6c0e301182f7b6a0897cf2
  - CI: fix kolla-ansible installation after cryptography 3.4 release
    
    Installing kolla-ansible system-wide on CentOS 8 fails with:
    
        ModuleNotFoundError: No module named 'setuptools_rust'
    
    This error appeared following the release of cryptography 3.4, which now
    includes Rust code. It can be installed without Rust using a Python
    wheel, but only with more recent pip than version 9.0.3 available as RPM
    on CentOS 8. The cryptography bug report [1] recommends pip>=19.1.1.
    
    This change switches to using pip --user when installing kolla-ansible.
    
    Also fixes an issue with ansible-lint which was failing on
    etc/kolla/globals.yml due to a missing space before comments.
    
    [1] pyca/cryptography#5753
    
    Change-Id: Ifaf1948ed5d42eebaa62d7bad375bbfc12b134d5
    Closes-Bug: #1915141
openstack-mirroring pushed a commit to openstack-archive/tripleo-validations that referenced this issue Feb 12, 2021
Molecule jobs[0] fails with below error:-

ModuleNotFoundError: No module named 'setuptools_rust'

This error appeared following the release of cryptography 3.4, which
now includes Rust code. It can be installed without Rust using a
Python wheel, but only with more recent pip than version 9.0.3
available as RPM on CentOS 8.

The cryptography bug report [1] recommends pip>=19.1.1.

[0] https://e99635be2c7386b5beda-3dea60a35fb0d38e41c535f13b48e895.ssl.cf1.rackcdn.com/773531/1/gate/tripleo-ansible-centos-8-molecule-tripleo_network_config/b1284cd/job-output.txt
[1] pyca/cryptography#5753
Related-Bug: #1915101

Depends-On: https://review.opendev.org/c/openstack/tripleo-validations/+/774814
Change-Id: Ib5baad39dd7e43dff9046178c00b0f836dc18bae
(cherry picked from commit 0bf7951)
openstack-mirroring pushed a commit to openstack/openstack that referenced this issue Feb 12, 2021
* Update kolla-ansible from branch 'master'
  to 638e00cfb1ba93448eb12efbd8d3f3c2662fbe53
  - Merge "CI: fix ceph-ansible installation after cryptography 3.4 release"
  - CI: fix ceph-ansible installation after cryptography 3.4 release
    
    Installing ceph-ansible in the virtualenv on CentOS 8 fails with:
    
        ModuleNotFoundError: No module named 'setuptools_rust'
    
    This error appeared following the release of cryptography 3.4, which now
    includes Rust code. It can be installed without Rust using a Python
    wheel, but only with more recent pip than version 9.0.3 available as RPM
    on CentOS 8. The cryptography bug report [1] recommends pip>=19.1.1.
    
    This change upgrades pip in the virtualenv before installing
    ceph-ansible.
    
    [1] pyca/cryptography#5753
    
    Change-Id: I47473de6f71c422db2238d653c2d8f379c55e79b
openstack-mirroring pushed a commit to openstack/kolla-ansible that referenced this issue Feb 12, 2021
Installing ceph-ansible in the virtualenv on CentOS 8 fails with:

    ModuleNotFoundError: No module named 'setuptools_rust'

This error appeared following the release of cryptography 3.4, which now
includes Rust code. It can be installed without Rust using a Python
wheel, but only with more recent pip than version 9.0.3 available as RPM
on CentOS 8. The cryptography bug report [1] recommends pip>=19.1.1.

This change upgrades pip in the virtualenv before installing
ceph-ansible.

[1] pyca/cryptography#5753

Change-Id: I47473de6f71c422db2238d653c2d8f379c55e79b
openstack-mirroring pushed a commit to openstack/kolla-ansible that referenced this issue Feb 15, 2021
Installing kolla-ansible system-wide on CentOS 8 fails with:

    ModuleNotFoundError: No module named 'setuptools_rust'

This error appeared following the release of cryptography 3.4, which now
includes Rust code. It can be installed without Rust using a Python
wheel, but only with more recent pip than version 9.0.3 available as RPM
on CentOS 8. The cryptography bug report [1] recommends pip>=19.1.1.

This change switches to using pip --user when installing kolla-ansible.

Also fixes an issue with ansible-lint which was failing on
etc/kolla/globals.yml due to a missing space before comments.

This Victoria backport also includes
I47473de6f71c422db2238d653c2d8f379c55e79b, which fixes a similar issue
with ceph-ansible.
(cherry picked from commit 5fc7707)

This Victoria backport also includes
I4c65a428facdf6d4ce28d97a868589aeae4c856e, which drops lower-constraints
testing.  Per our PTG resolution [2] and general OpenStack resolution
[3], lower-constraints are not worth the extra work and confusion they
introduce.  This patch drops them along with all mentions.
(cherry picked from commit 604d85b)

[1] pyca/cryptography#5753
[2] http://lists.openstack.org/pipermail/openstack-discuss/2020-October/018445.html
[3] http://lists.openstack.org/pipermail/openstack-discuss/2020-December/019521.html

Change-Id: Ifaf1948ed5d42eebaa62d7bad375bbfc12b134d5
(cherry picked from commit 3dd6834)
Closes-Bug: #1915141
rht-perf-ci pushed a commit to cloud-bulldozer/browbeat that referenced this issue Feb 16, 2021
not available by default when using the distribution packages
pyca/cryptography#5753

To resolve this, we upgrade pip in the virtualenv if it
is not new enough. We maintain the pin on <20 to ensure
that it is usable in both python2 and python3 environments
and that it doesn't bring any new setuptools requirements
into the mix.

Change-Id: I1adb92ee823558bd4e6b70ca961669ccf3e0434b
openstack-mirroring pushed a commit to openstack/kolla-ansible that referenced this issue Feb 16, 2021
Installing ceph-ansible in the virtualenv on CentOS 8 fails with:

    ModuleNotFoundError: No module named 'setuptools_rust'

This error appeared following the release of cryptography 3.4, which now
includes Rust code. It can be installed without Rust using a Python
wheel, but only with more recent pip than version 9.0.3 available as RPM
on CentOS 8. The cryptography bug report [1] recommends pip>=19.1.1.

This change upgrades pip in the virtualenv before installing
ceph-ansible.

[1] pyca/cryptography#5753

Change-Id: I47473de6f71c422db2238d653c2d8f379c55e79b
(cherry picked from commit 5fc7707)
infothrill added a commit to infothrill/ansible-role-rpi_boot_config that referenced this issue Feb 18, 2021
@saper
Copy link

saper commented Feb 23, 2021

That did it, thanks!

You may also switch to virtualenv instead of venv - this will installed the latest pip inside as well.

openstack-mirroring pushed a commit to openstack-archive/tripleo-validations that referenced this issue Mar 19, 2021
Molecule jobs[0] fails with below error:-

ModuleNotFoundError: No module named 'setuptools_rust'

This error appeared following the release of cryptography 3.4, which
now includes Rust code. It can be installed without Rust using a
Python wheel, but only with more recent pip than version 9.0.3
available as RPM on CentOS 8.

The cryptography bug report [1] recommends pip>=19.1.1.

[0] https://e99635be2c7386b5beda-3dea60a35fb0d38e41c535f13b48e895.ssl.cf1.rackcdn.com/773531/1/gate/tripleo-ansible-centos-8-molecule-tripleo_network_config/b1284cd/job-output.txt
[1] pyca/cryptography#5753
Related-Bug: #1915101

Depends-On: https://review.opendev.org/c/openstack/tripleo-validations/+/774814
Change-Id: Ib5baad39dd7e43dff9046178c00b0f836dc18bae
(cherry picked from commit 0bf7951)
(cherry picked from commit 90b47a4)
openstack-mirroring pushed a commit to openstack-archive/tripleo-validations that referenced this issue Mar 19, 2021
Molecule jobs[0] fails with below error:-

ModuleNotFoundError: No module named 'setuptools_rust'

This error appeared following the release of cryptography 3.4, which
now includes Rust code. It can be installed without Rust using a
Python wheel, but only with more recent pip than version 9.0.3
available as RPM on CentOS 8.

The cryptography bug report [1] recommends pip>=19.1.1.

[0] https://e99635be2c7386b5beda-3dea60a35fb0d38e41c535f13b48e895.ssl.cf1.rackcdn.com/773531/1/gate/tripleo-ansible-centos-8-molecule-tripleo_network_config/b1284cd/job-output.txt
[1] pyca/cryptography#5753
Related-Bug: #1915101

Depends-On: https://review.opendev.org/c/openstack/tripleo-validations/+/774814
Change-Id: Ib5baad39dd7e43dff9046178c00b0f836dc18bae
(cherry picked from commit 0bf7951)
(cherry picked from commit 90b47a4)
(cherry picked from commit b1ddfda)
nsano-rururu referenced this issue in nsano-rururu/docker-compose-ui Mar 30, 2021
docker-compose 1.27.4 to 1.28.5
gitpython 3.1.11 to 3.1.14
ython:3.9.1-alpine to ython:3.9.2-alpine
@tmarplatt
Copy link

For anyone else running into this same issue, for whom updating pip is not enough, here's what worked for me. While installing cryptography on a Debian 10 Buster docker container, I also had to upgrade setuptools (40.8.0 -> 56.0.0), so the command that fixed my issues was:

python3 -m pip install -U pip setuptools

@AunRaza21
Copy link

Run this command inside your venv.
pip3 install -U pip
It solved my issue. Thanks !

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Sep 26, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Development

No branches or pull requests