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
pkg_resources is deprecated as an API for python 3.13.5 #8536
When installing monai and importing in python 3.13.5, we get a deprecation warning:
Python 3.13.5 (main, Jul 28 2025, 00:00:00) [GCC 11.5.0 20240719 (Red Hat 11.5.0-5)] on linux
Type "help", "copyright", "credits" or "license" for more information.
import monai
/data/devspace/marc/game-on-autoptz/venv/lib64/python3.13/site-packages/monai/utils/module.py:399: UserWarning: pkg_resources is deprecated as an API. See https://setuptools.pypa.io/en/latest/pkg_resources.html. The pkg_resources package is slated for removal as early as 2025-11-30. Refrain from using this package or pin to Setuptools<81.
pkg = import(module) # top level module
This would need to be solved in future updates to prevent from breaking
Hi @mgraugal thanks for flagging this. We don't use pkg_resources any more but this might be warned as part of our import process. When this package is removed there shouldn't be a problem and the warning will cease.
The pkg_resouces package has now been removed from PyPI rather than just deprecated, MONAI itself isn't affected but downstream projects are, specifically MetricsReloaded. As a result installing these packages through pip fails with an error about the package not being found.
The solution used with MONAI is to ensure a working version of setuptools is installed in an environment, then use the pip --no-build-isolation option to force building in that environment when installing requirements. This avoids subsequent build operations installing a newer version which has this issue. This has been done in #8738 by @KumoLiu and other PRs to update the tutorials and model zoo repos are in progress. We do need to update MetricsReloaded however to eliminate the need for this fix (CC @csudre).
Activity
ericspod commentedon Aug 12, 2025
Hi @mgraugal thanks for flagging this. We don't use pkg_resources any more but this might be warned as part of our import process. When this package is removed there shouldn't be a problem and the warning will cease.
ericspod commentedon Feb 13, 2026
The
pkg_resoucespackage has now been removed from PyPI rather than just deprecated, MONAI itself isn't affected but downstream projects are, specifically MetricsReloaded. As a result installing these packages through pip fails with an error about the package not being found.The solution used with MONAI is to ensure a working version of
setuptoolsis installed in an environment, then use the pip--no-build-isolationoption to force building in that environment when installing requirements. This avoids subsequent build operations installing a newer version which has this issue. This has been done in #8738 by @KumoLiu and other PRs to update the tutorials and model zoo repos are in progress. We do need to update MetricsReloaded however to eliminate the need for this fix (CC @csudre).ericspod commentedon Feb 13, 2026
Related issue: pypa/setuptools#5174
Actions Updates For `pkg_resources` Fix (#775)
Edited devcontainer and followed suggestion at this link: Project-MON…