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

pkg_resources error in django-widget-tweaks after upgrading to Python 3.12 on my distro (Fedora 39) #141

Closed
AmoahDevLabs opened this issue Nov 23, 2023 · 2 comments

Comments

@AmoahDevLabs
Copy link

AmoahDevLabs commented Nov 23, 2023

This issue is with Python 3.12 and I suggest it should be fixed in no time because some projects using django-widget-tweaks are broken after system upgrade (Fedora 39). I guess all other distros that switched to Python 3.12 are having this issue as well.

Error:

venv/lib/python3.12/site-packages/widget_tweaks/init.py", line 1, in
from pkg_resources import get_distribution, DistributionNotFound
ModuleNotFoundError: No module named 'pkg_resources'

Where pkg_resources is called:
"venv/lib/python3.12/site-packages/widget_tweaks/init.py"

from pkg_resources import get_distribution, DistributionNotFound

try:
version = get_distribution("django-widget-tweaks").version
except DistributionNotFound:
# package is not installed
version = None

@joshuadavidthomas
Copy link

joshuadavidthomas commented Jan 28, 2024

Looks like in 3.12 pkg_resources is not installed by default:

easy_install, pkg_resources, setuptools and distutils are no longer provided by default in environments created with venv or bootstrapped with ensurepip, since they are part of the setuptools package. For projects relying on these at runtime, the setuptools project should be declared as a dependency and installed separately (typically, using pip).

Looks like this was fixed in #135 and released in 1.5.0. What version of django-widget-tweaks are you using?

@AmoahDevLabs
Copy link
Author

Alright I am currently using django-widget-tweaks==1.5.0

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

No branches or pull requests

2 participants