1

anyone knows how to overcome the below error returned when I try to install "cryptography" within a python3.11 virtual environment on a Linux Debian 12 machine?

I am posting the below the command with the debugs and final error returned.

error:

Running command Preparing metadata (pyproject.toml)
  Python reports SOABI: cpython-311-i386-linux-gnu
  Computed rustc target triple: i386-unknown-linux-gnu
  Target triple not supported by rustup: i386-unknown-linux-gnu
  Checking for Rust toolchain....
  Rust not found, installing into a temporary directory
  error: subprocess-exited-with-error

  × Preparing metadata (pyproject.toml) did not run successfully.
  │ exit code: 1
  ╰─> See above for output.

  note: This error originates from a subprocess, and is likely not a problem with pip.
  full command: /home/jt/orch-pro-beta-1.5/jvenv/bin/python3 /home/jt/orch-pro-beta-1.5/jvenv/lib/python3.11/site-packages/pip/_vendor/pyproject_hooks/_in_process/_in_process.py prepare_metadata_for_build_wheel /tmp/tmp6ml2yl8m
  cwd: /tmp/pip-install-7k0mrh77/cryptography_e81d808a01a14a0f99d47d3d0829015f
  Preparing metadata (pyproject.toml) ... error
error: metadata-generation-failed

× Encountered error while generating package metadata.
╰─> See above for output.

note: This is an issue with the package mentioned above, not pip.
hint: See above for details.

I have searched for "rust not found" error and tried to install rust using the below (although I am not sure what is rust and why is it needed)

curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh

complete output:

 pip3 install cryptography --verbose
Using pip 23.0.1 from /home/jt/orch-pro-beta-1.5/jvenv/lib/python3.11/site-packages/pip (python 3.11)
Collecting cryptography
  Using cached cryptography-45.0.3.tar.gz (744 kB)
  Running command pip subprocess to install build dependencies
  Collecting maturin<2,>=1.8.6
    Using cached maturin-1.8.6-py3-none-manylinux_2_12_i686.manylinux2010_i686.musllinux_1_1_i686.whl (7.8 MB)
  Collecting cffi>=1.14
    Using cached cffi-1.17.1-cp311-cp311-manylinux_2_12_i686.manylinux2010_i686.manylinux_2_17_i686.manylinux2014_i686.whl (445 kB)
  Collecting setuptools!=74.0.0,!=74.1.0,!=74.1.1,!=74.1.2
    Using cached setuptools-80.9.0-py3-none-any.whl (1.2 MB)
  Collecting pycparser
    Using cached pycparser-2.22-py3-none-any.whl (117 kB)
  Installing collected packages: setuptools, pycparser, maturin, cffi
  Successfully installed cffi-1.17.1 maturin-1.8.6 pycparser-2.22 setuptools-80.9.0
  Installing build dependencies ... done
  Running command Getting requirements to build wheel
  Getting requirements to build wheel ... done
  Running command pip subprocess to install backend dependencies
  Collecting puccinialin
    Using cached puccinialin-0.1.4-py3-none-any.whl (7.3 kB)
  Collecting httpx<0.29,>=0.28.1
    Using cached httpx-0.28.1-py3-none-any.whl (73 kB)
  Collecting platformdirs<5,>=4.3.6
    Using cached platformdirs-4.3.8-py3-none-any.whl (18 kB)
  Collecting tqdm<5,>=4.67.1
    Using cached tqdm-4.67.1-py3-none-any.whl (78 kB)
  Collecting anyio
    Using cached anyio-4.9.0-py3-none-any.whl (100 kB)
  Collecting certifi
    Using cached certifi-2025.4.26-py3-none-any.whl (159 kB)
  Collecting httpcore==1.*
    Using cached httpcore-1.0.9-py3-none-any.whl (78 kB)
  Collecting idna
    Using cached idna-3.10-py3-none-any.whl (70 kB)
  Collecting h11>=0.16
    Using cached h11-0.16.0-py3-none-any.whl (37 kB)
  Collecting sniffio>=1.1
    Using cached sniffio-1.3.1-py3-none-any.whl (10 kB)
  Collecting typing_extensions>=4.5
    Using cached typing_extensions-4.13.2-py3-none-any.whl (45 kB)
  Installing collected packages: typing_extensions, tqdm, sniffio, platformdirs, idna, h11, certifi, httpcore, anyio, httpx, puccinialin
  Successfully installed anyio-4.9.0 certifi-2025.4.26 h11-0.16.0 httpcore-1.0.9 httpx-0.28.1 idna-3.10 platformdirs-4.3.8 puccinialin-0.1.4 sniffio-1.3.1 tqdm-4.67.1 typing_extensions-4.13.2
  Installing backend dependencies ... done
  Running command Preparing metadata (pyproject.toml)
  Python reports SOABI: cpython-311-i386-linux-gnu
  Computed rustc target triple: i386-unknown-linux-gnu
  Target triple not supported by rustup: i386-unknown-linux-gnu
  Checking for Rust toolchain....
  Rust not found, installing into a temporary directory
  error: subprocess-exited-with-error

  × Preparing metadata (pyproject.toml) did not run successfully.
  │ exit code: 1
  ╰─> See above for output.

  note: This error originates from a subprocess, and is likely not a problem with pip.
  full command: /home/jt/orch-pro-beta-1.5/jvenv/bin/python3 /home/jt/orch-pro-beta-1.5/jvenv/lib/python3.11/site-packages/pip/_vendor/pyproject_hooks/_in_process/_in_process.py prepare_metadata_for_build_wheel /tmp/tmp6ml2yl8m
  cwd: /tmp/pip-install-7k0mrh77/cryptography_e81d808a01a14a0f99d47d3d0829015f
  Preparing metadata (pyproject.toml) ... error
error: metadata-generation-failed

× Encountered error while generating package metadata.
╰─> See above for output.

note: This is an issue with the package mentioned above, not pip.
hint: See above for details.
8
  • what is your question? ... please edit your post ... add a focused, answerable question to your post Commented May 29 at 18:33
  • my question is about the mentioned error in the post. I re-edited the post anyways. Commented May 29 at 19:42
  • Is pip --verbos a typo? Did you mean pip --verbose Commented May 29 at 21:21
  • Perhaps you need pip install cryptography --verbose Commented May 29 at 21:34
  • 1
    "just a missed letter when i copied and pasted the commands." This is a typo. Commented May 30 at 10:56

1 Answer 1

1

The issue was resolved by the following actions:

1- installing the cryptography module on the system wide scope

apt-get install python3-cryptography

2- after the above steps, when trying to install the cryptography within my python venv, the errors retuned were clearer to understand. Tracing the new errors one by one, I managed to finally resolve the issue. The below actions were taken:

apt-get install python3-openssl
apt-get install pkg-config
apt-get install libssl-dev
apt-get install cargo

After the above installations, I retried to install cryptography into my venv using pip:

pip3 install cryptography

I am not fully aware about the above dependencies nor why it was important to install python3-cryptography system wide. But this was how it worked.

Sign up to request clarification or add additional context in comments.

1 Comment

You are awesooooome! Thank you!

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.