Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Undeclared runtime dependency on setuptools/pkg-resources #506

Closed
edwardpeek-crown-public opened this issue Nov 9, 2021 · 2 comments
Closed

Comments

@edwardpeek-crown-public
Copy link

Problem

Importing model_utils in a python environment that does not have setuptools installed fails with error:

  ...
  File "REDACTED/venv/lib/python3.9/site-packages/model_utils/__init__.py", line 1, in <module>
    from pkg_resources import DistributionNotFound, get_distribution
ModuleNotFoundError: No module named 'pkg_resources'

but setuptools is not listed under install_requires in setup.py.

This can occur when using the pip options --prefix, --root, --target to use different python environments between install/runtime.

Environment

  • Django Model Utils version: 4.1.1 / HEAD
  • Django version: 3.2.4
  • Python version: 3.9
  • Other libraries used, if any: setuptools absent

Code examples

N/A

@patrick91
Copy link
Contributor

I just had this, for reference I installed model utils using pdm 😊

@foarsitter
Copy link
Contributor

foarsitter commented Jun 16, 2023

#545 replaced pkg_resource with importlib

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants