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

PIP not importing most recent changes?

Open varlenthegray opened this issue 2 years ago • 2 comments

I'm running Django 4.0.6 and it appears that the code has been updated to the new force_str instead of force_text per GitHub, however PIP v 0.1.3 doesn't show these changes.

Running python3 manage.py check returns the following:

Traceback (most recent call last):
  File "/home/wcadev/.local/lib/python3.8/site-packages/simplemde/utils.py", line 5, in <module>
    from django.utils.encoding import force_text
ImportError: cannot import name 'force_text' from 'django.utils.encoding' (/home/wcadev/.local/lib/python3.8/site-packages/django/utils/encoding.py)

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "manage.py", line 22, in <module>
    main()
  File "manage.py", line 18, in main
    execute_from_command_line(sys.argv)
  File "/home/wcadev/.local/lib/python3.8/site-packages/django/core/management/__init__.py", line 446, in execute_from_command_line
    utility.execute()
  File "/home/wcadev/.local/lib/python3.8/site-packages/django/core/management/__init__.py", line 420, in execute
    django.setup()
  File "/home/wcadev/.local/lib/python3.8/site-packages/django/__init__.py", line 24, in setup
    apps.populate(settings.INSTALLED_APPS)
  File "/home/wcadev/.local/lib/python3.8/site-packages/django/apps/registry.py", line 116, in populate
    app_config.import_models()
  File "/home/wcadev/.local/lib/python3.8/site-packages/django/apps/config.py", line 304, in import_models
    self.models_module = import_module(models_module_name)
  File "/usr/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 848, in exec_module
  File "<frozen importlib._bootstrap>", line 219, in _call_with_frames_removed
  File "/home/wcadev/public_html/wcadmin/communication/models.py", line 4, in <module>
    from simplemde.fields import SimpleMDEField
  File "/home/wcadev/.local/lib/python3.8/site-packages/simplemde/fields.py", line 4, in <module>
    from .widgets import SimpleMDEEditor
  File "/home/wcadev/.local/lib/python3.8/site-packages/simplemde/widgets.py", line 13, in <module>
    from .utils import json_dumps
  File "/home/wcadev/.local/lib/python3.8/site-packages/simplemde/utils.py", line 7, in <module>
    from django.utils.encoding import force_unicode as force_text
ImportError: cannot import name 'force_unicode' from 'django.utils.encoding' (/home/wcadev/.local/lib/python3.8/site-packages/django/utils/encoding.py)

varlenthegray avatar Jul 15 '22 00:07 varlenthegray

Additionally, forcing an update with a manual GitHub download resolved the errors.

varlenthegray avatar Jul 15 '22 00:07 varlenthegray

I have uploaded a new version to pypi which includes the latest compatibility changes for Django 4.0+. Please try again.

onepill avatar Jul 18 '22 07:07 onepill