stan-dev / pystan

PyStan, a Python interface to Stan, a platform for statistical modeling. Documentation: https://pystan.readthedocs.io
ISC License
337 stars 58 forks source link

Python3.12 Compatibility #405

Closed BrandonReeve closed 5 months ago

BrandonReeve commented 7 months ago

Python3.12 Installation Issues

When downloading pystan using python3.12 it fails.

Describe your system

WSL2 Ubuntu 22.04 Python 3.12

Steps/Code to Reproduce

Install python 3.12 make venv pip install pystan

Error

error: subprocess-exited-with-error

  × python setup.py bdist_wheel did not run successfully.
  │ exit code: 1
  ╰─> [3 lines of output]
      /tmp/pip-install-s20ev12c/pystan_4519ccd5ec604a24a1c97193644257bc/setup.py:61: DeprecationWarning: Attribute s is deprecated and will be removed in Python 3.14; use value instead
        self.version = node.value.s
      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: Failed building wheel for pystan
  Running setup.py clean for pystan
Failed to build pystan
ERROR: Could not build wheels for pystan, which is required to install pyproject.toml-based projects

Do you know if you will add python3.12 support in the future?

riddell-stan commented 7 months ago

There are some Python 3.12 issues with pystan's dependencies. There will be a Python 3.12 release at some point.

rezabehboudi commented 5 months ago

What is your estimation time of the compatible release?

jachymb commented 5 months ago

I have troubles installing PyStan even with Python 3.11. Not sure if it's related to this. Which is the newest officially supported python version?

rezabehboudi commented 5 months ago

I have troubles installing PyStan even with Python 3.11. Not sure if it's related to this. Which is the newest officially supported python version?

I have installed it with 3.10 and now it works.

riddell-stan commented 5 months ago

Python 3.11 should work. Please open a new issue.

Python 3.12 wheels aren't ready due to an issue with a dependency not supporting 3.12. No estimate about when I'll have time for this. Sorry I don't have better news. Installing httpstan first (via source) under Python 3.12 might work.

riddell-stan commented 5 months ago

This isn't really a bug report so I'm going to close it.

In the future, please post this kind of thing on the Stan Forums.

riddell-stan commented 5 months ago

Python 3.12 should work with pystan 3.9.1 (released today).