You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
PyBioNetGen fails with setuptools ≥81 (Python 3.12) #61
PyBioNetGen 0.8.3 fails to run when installed in an environment with
modern setuptools (≥81).
The failure is due to removal of pkg_resources from setuptools, while
PyBioNetGen still imports:
frompkg_resourcesimportpackaging
This causes a runtime ModuleNotFoundError.
Environment
macOS (Darwin)
Python 3.12
PyBioNetGen 0.8.3
setuptools 82.0.1
Installed in a clean virtual environment
Error
Running:
bionetgen --version
Produces:
Traceback (most recent call last):
File ".../.venv/bin/bionetgen", line 4, in <module>
from bionetgen.main import main
File ".../site-packages/bionetgen/main.py", line 21, in <module>
from pkg_resources import packaging
ModuleNotFoundError: No module named 'pkg_resources'
Direct import also fails:
python -c "import pkg_resources"
ModuleNotFoundError: No module named 'pkg_resources'
Root Cause
As of setuptools 81+, pkg_resources has been removed.
PyBioNetGen currently imports:
frompkg_resourcesimportpackaging
This dependency no longer works with modern Python packaging stacks.
Temporary Workaround
Downgrade setuptools:
pip install "setuptools<81"
After downgrading, PyBioNetGen runs normally.
Proposed Fix
Replace usage of:
frompkg_resourcesimportpackaging
With:
frompackagingimportversion
And add packaging as a direct dependency in pyproject.toml or setup.py.
This removes reliance on deprecated pkg_resources and restores
compatibility with modern setuptools and Python 3.12+.
Impact
Breaks fresh Python 3.12 installations
Breaks modern virtual environments
Affects users using uv, pip, conda, or other modern packaging
toolchains
Recommendation
Remove dependency on pkg_resources
Depend directly on packaging
Add CI testing against Python 3.12 and latest setuptools
Activity
akutuva21 commentedon Mar 17, 2026
Should be fixed in #63
fix: rule modifiers, Python 3.12 compat, CI overhaul, NFsim version