Metadata-generation-failed error installing pystan on debian

I’m trying to install pystan on a Raspberry Pi 4.

Running python3 -m pip install pystan yields the following

Looking in indexes: https://pypi.org/simple, https://www.piwheels.org/simple
Collecting pystan
  Using cached https://www.piwheels.org/simple/pystan/pystan-3.3.0-py3-none-any.whl (13 kB)
Collecting aiohttp<4.0,>=3.6 (from pystan)
  Using cached https://www.piwheels.org/simple/aiohttp/aiohttp-3.8.4-cp37-cp37m-linux_armv7l.whl (486 kB)
Collecting clikit<0.7,>=0.6 (from pystan)
  Using cached https://www.piwheels.org/simple/clikit/clikit-0.6.2-py2.py3-none-any.whl (91 kB)
INFO: pip is looking at multiple versions of pystan to determine which version is compatible with other requirements. This could take a while.
Collecting pystan
  Using cached https://www.piwheels.org/simple/pystan/pystan-3.2.0-py3-none-any.whl (13 kB)
  Using cached https://www.piwheels.org/simple/pystan/pystan-3.1.1-py3-none-any.whl (13 kB)
  Using cached https://www.piwheels.org/simple/pystan/pystan-3.1.0-py3-none-any.whl (13 kB)
  Using cached https://www.piwheels.org/simple/pystan/pystan-3.0.2-py3-none-any.whl (13 kB)
  Using cached https://www.piwheels.org/simple/pystan/pystan-3.0.1-py3-none-any.whl (12 kB)
  Using cached https://www.piwheels.org/simple/pystan/pystan-3.0.0-py3-none-any.whl (12 kB)
  Using cached pystan-2.19.1.1.tar.gz (16.2 MB)
  Installing build dependencies ... done
  Getting requirements to build wheel ... done
  Preparing metadata (pyproject.toml) ... error
  error: subprocess-exited-with-error
  
  × Preparing metadata (pyproject.toml) did not run successfully.
  │ exit code: 1
  ╰─> [1 lines of output]
      Cython>=0.22 and NumPy are required.
      [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.

This is weird to me because I have both Cython (0.29.34) and Numpy (1.21.6) installed and working fine. I’d be grateful for any advice!

1 Like

I ran into this issue trying to install with python 3.11. Downgraded to python 3.9 and then I no longer received the error.

I get the same error.

note that I think I have numpy and cython installed. and python 3.9
pip 21.2.4 from /Library/Developer/CommandLineTools/Library/Frameworks/Python3.framework/Versions/3.9/lib/python3.9/site-packages/pip (python 3.9)

(.venv) gavin.steininger@gavin-steininger-H4726GQXYF httpstan % pip3 show cython
Name: Cython
Version: 0.29.36
Summary: The Cython compiler for writing C extensions for the Python language.
Home-page: http://cython.org/
Author: Robert Bradshaw, Stefan Behnel, Dag Seljebotn, Greg Ewing, et al.
Author-email: cython-devel@python.org
License: Apache
Location: /Users/gavin.steininger/Desktop/.venv/lib/python3.9/site-packages
Requires:
Required-by:
(.venv) gavin.steininger@gavin-steininger-H4726GQXYF httpstan % pip3 show numpy
Name: numpy
Version: 1.23.0
Summary: NumPy is the fundamental package for array computing with Python.
Home-page: https://www.numpy.org
Author: Travis E. Oliphant et al.
Author-email:
License: BSD
Location: /Users/gavin.steininger/Desktop/.venv/lib/python3.9/site-packages
Requires:
Required-by: httpstan
(.venv) gavin.steininger@gavin-steininger-H4726GQXYF httpstan % pip3 show httpstan
Name: httpstan
Version: 4.11.0
Summary: HTTP-based interface to Stan, a package for Bayesian inference.
Home-page: https://mc-stan.org
Author: Allen Riddell
Author-email: riddella@indiana.edu
License: ISC
Location: /Users/gavin.steininger/Desktop/.venv/lib/python3.9/site-packages
Requires: aiohttp, appdirs, marshmallow, numpy, setuptools, webargs
Required-by: