Skip to content

No module named 'pkg_resources' #414

@MichaelClerx

Description

@MichaelClerx

Describe the bug

Pystan can't be imported if setuptools 82 or newer is installed.
Instead, it raises

  File "/home/michael/dev/pints/venv/lib/python3.12/site-packages/stan/model.py", line 18, in <module>
    import stan.plugins
  File "/home/michael/dev/pints/venv/lib/python3.12/site-packages/stan/plugins.py", line 4, in <module>
    import pkg_resources
ModuleNotFoundError: No module named 'pkg_resources'

This was long deprecated: https://setuptools.pypa.io/en/stable/pkg_resources.html
And has now been removed: https://setuptools.pypa.io/en/latest/history.html#deprecations-and-removals

Describe your system

Python 3.12, with Setuptools 82

Steps/Code to Reproduce

Install PyStan, install setuptools>=82, run below

Code Sample, a copy-pastable example

import stan

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions