Solved Python cannot install module maturin: Preparing metadata (pyproject.toml) did not run successfully.

Hello,
I am trying to install the Python module python-jose[cryptography] but the installation fails while building dependencies. I'm not sure if the problem is with Python pip and the package, or with a missing FreeBSD pkg (or port). I'm running this in a venv with Python 3.11.11.
The big clue is when it tries to install a dependency for maturin:
Code:
× Preparing metadata (pyproject.toml) did not run successfully.
        │ exit code: 1
        ╰─> [3 lines of output]
            Python reports SOABI: cpython-311
            Unsupported platform: 311
            Rust not found, installing into a temporary directory
            [end of output]
Install rust from a FreeBSD pkg? Which one?
Downgrade Python to a previous version?
Complain about Pypi? (it's fashionable these days)
Thanks

This is the general environment (using venv):
Code:
$ uname -a
FreeBSD grendel.local 14.2-RELEASE-p1 FreeBSD 14.2-RELEASE-p1 GENERIC amd64

$ python --version
Python 3.11.11

$ pip --version
pip 25.1.1 from /usr/local/www/radiation-map/venv/lib/python3.11/site-packages/pip (python 3.11)

The full output is here:
Code:
(venv) louis@grendel:/usr/local/www/radiation-map $ pip install python-jose[cryptography]
Collecting python-jose[cryptography]
  Using cached python_jose-3.4.0-py2.py3-none-any.whl.metadata (5.5 kB)
Collecting ecdsa!=0.15 (from python-jose[cryptography])
  Using cached ecdsa-0.19.1-py2.py3-none-any.whl.metadata (29 kB)
Collecting rsa!=4.1.1,!=4.4,<5.0,>=4.0 (from python-jose[cryptography])
  Using cached rsa-4.9.1-py3-none-any.whl.metadata (5.6 kB)
Collecting pyasn1<0.5.0,>=0.4.1 (from python-jose[cryptography])
  Using cached pyasn1-0.4.8-py2.py3-none-any.whl.metadata (1.5 kB)
Collecting cryptography>=3.4.0 (from python-jose[cryptography])
  Using cached cryptography-44.0.3.tar.gz (711 kB)
  Installing build dependencies ... error
  error: subprocess-exited-with-error
  
  × pip subprocess to install build dependencies did not run successfully.
  │ exit code: 1
  ╰─> [28 lines of output]
      Collecting maturin<2,>=1
        Using cached maturin-1.8.6.tar.gz (203 kB)
        Installing build dependencies: started
        Installing build dependencies: finished with status 'done'
        Getting requirements to build wheel: started
        Getting requirements to build wheel: finished with status 'done'
        Installing backend dependencies: started
        Installing backend dependencies: finished with status 'done'
        Preparing metadata (pyproject.toml): started
        Preparing metadata (pyproject.toml): finished with status 'error'
        error: subprocess-exited-with-error
      
        × Preparing metadata (pyproject.toml) did not run successfully.
        │ exit code: 1
        ╰─> [3 lines of output]
            Python reports SOABI: cpython-311
            Unsupported platform: 311
            Rust not found, installing into a temporary directory
            [end of output]
      
        note: This error originates from a subprocess, and is likely not a problem with pip.
      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.
      [end of output]
  
  note: This error originates from a subprocess, and is likely not a problem with pip.
error: subprocess-exited-with-error

× pip subprocess to install build dependencies 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.
 
Yes, it needed rustc. I got confused by the "unsupported platform 311" message.
I added the package and it worked fine.
Thanks!
 
Back
Top