django-multiselectfield icon indicating copy to clipboard operation
django-multiselectfield copied to clipboard

[BUG] Fails in Django 3.0

Open C0DK opened this issue 5 years ago • 8 comments

After upgrading to django 3.0, the module fails, it seems, due to some dependency on python_2 things from django, which might have been removed or changed. AFAIK python2 isn't officially supported anywhere anymore in 20~ days.

  File ".../venv/lib/python3.8/importlib/__init__.py", line 127, in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
  File "<frozen importlib._bootstrap>", line 1014, in _gcd_import
  File "<frozen importlib._bootstrap>", line 991, in _find_and_load
  File "<frozen importlib._bootstrap>", line 975, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 671, in _load_unlocked
  File "<frozen importlib._bootstrap_external>", line 783, in exec_module
  File "<frozen importlib._bootstrap>", line 219, in _call_with_frames_removed
  File ".../venv/lib/python3.8/site-packages/multiselectfield/__init__.py", line 1, in <module>
    from multiselectfield.db.fields import MultiSelectField  # noqa: F401
  File ".../venv/lib/python3.8/site-packages/multiselectfield/db/fields.py", line 23, in <module>
    from django.utils.encoding import python_2_unicode_compatible
ImportError: cannot import name 'python_2_unicode_compatible' from 'django.utils.encoding' (.../venv/lib/python3.8/site-packages/django/utils/encoding.py)

C0DK avatar Dec 10 '19 10:12 C0DK

Hi, thanks for reporting this bug. Should we remove support for python2 here? Anyway, this bug comes from Django 3.0, doesn't it?

tomasgarzon avatar Dec 10 '19 10:12 tomasgarzon

Sorry - yes - django3.0 - i'll edit the title

Maybe you could also utilize the new enum types that django officially support now. https://docs.djangoproject.com/en/3.0/ref/models/fields/#field-choices-enum-types

I'd probably create a "final" python2 version, and then slowly drop support, if i were you guys. It's a mess to support both it'd say.

C0DK avatar Dec 10 '19 10:12 C0DK

Hi, could you paste your pip freeze? which version have you installed? The current version doesn't have "python_2_unicode_compatible"

tomasgarzon avatar Dec 12 '19 11:12 tomasgarzon

"django-multiselectfield==0.1.8" it seems.

C0DK avatar Dec 16 '19 14:12 C0DK

ok, please update to last version 0.1.10.

tomasgarzon avatar Dec 16 '19 14:12 tomasgarzon

django-multiselect fields doesn not work on latest Django and Python combination due to python_2_unicode_compatible dependency

Django 3.1.1 Python 3.8.5 django-multipleselectfield 0.2.0.post2

Please assist with any feedback.

Ryan-F-Dyer avatar Oct 15 '20 09:10 Ryan-F-Dyer

Same issue django-multiselectfield==0.1.12 python 3.6.4 django 3.0.7

##Update Had to specifically use pip3 to install. Seems to be working now.

LeeMellon avatar Dec 16 '20 22:12 LeeMellon

Python 3.8.10 Django 3.2.x django-multiselectfield==0.1.12

Same problem as above. Had nobody made a fix for this yet? 🤔

eldamir avatar Nov 08 '21 07:11 eldamir

Fixed in #148.

blag avatar May 24 '24 19:05 blag