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

Bump django-widget-tweaks to 1.5.0 for compatibility with Python 3.12 #616

Closed
joshuadavidthomas opened this issue Jan 28, 2024 · 1 comment · Fixed by #618
Closed

Bump django-widget-tweaks to 1.5.0 for compatibility with Python 3.12 #616

joshuadavidthomas opened this issue Jan 28, 2024 · 1 comment · Fixed by #618

Comments

@joshuadavidthomas
Copy link

joshuadavidthomas commented Jan 28, 2024

When trying to get this running locally using Python 3.12, I ran in to the following error:

$ python manage.py migrate

Traceback (most recent call last):
  File "/home/josh/projects/linkding/manage.py", line 21, in <module>
    main()
  File "/home/josh/projects/linkding/manage.py", line 17, in main
    execute_from_command_line(sys.argv)
  File "/home/josh/.pyenv/versions/linkding-3.12/lib/python3.12/site-packages/django/core/management/__init__.py", line 446, in execute_from_command_line
    utility.execute()
  File "/home/josh/.pyenv/versions/linkding-3.12/lib/python3.12/site-packages/django/core/management/__init__.py", line 420, in execute
    django.setup()
  File "/home/josh/.pyenv/versions/linkding-3.12/lib/python3.12/site-packages/django/__init__.py", line 24, in setup
    apps.populate(settings.INSTALLED_APPS)
  File "/home/josh/.pyenv/versions/linkding-3.12/lib/python3.12/site-packages/django/apps/registry.py", line 91, in populate
    app_config = AppConfig.create(entry)
                 ^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/josh/.pyenv/versions/linkding-3.12/lib/python3.12/site-packages/django/apps/config.py", line 193, in create
    import_module(entry)
  File "/home/josh/.pyenv/versions/3.12.0/lib/python3.12/importlib/__init__.py", line 90, in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "<frozen importlib._bootstrap>", line 1381, in _gcd_import
  File "<frozen importlib._bootstrap>", line 1354, in _find_and_load
  File "<frozen importlib._bootstrap>", line 1325, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 929, in _load_unlocked
  File "<frozen importlib._bootstrap_external>", line 994, in exec_module
  File "<frozen importlib._bootstrap>", line 488, in _call_with_frames_removed
  File "/home/josh/.pyenv/versions/linkding-3.12/lib/python3.12/site-packages/widget_tweaks/__init__.py", line 1, in <module>
    from pkg_resources import get_distribution, DistributionNotFound
ModuleNotFoundError: No module named 'pkg_resources'

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).

This was fixed in jazzband/django-widget-tweaks#135 and released in version 1.5.0.

@joshuadavidthomas
Copy link
Author

Though, now that I actually look at the Development section of the README, you actually note this only supports Python 3.10 at the moment, so maybe I just need to learn to read a bit better. 🤣

Still, when it's decided to upgrade the base Python version, this will need to be addressed.

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.

1 participant