coddingtonbear / django-measurement

Easily store, retrieve, and convert measurements of weight, volume, distance, area and more.
MIT License
145 stars 32 forks source link

Compatibility with Django 3 #105

Closed raf-uwt closed 3 years ago

raf-uwt commented 3 years ago

Since library Six was removed in Django 3.x the measurement library is not longer working due to this dependency

from django_measurement.models import MeasurementField
  File "\lib\site-packages\django_measurement\models.py", line 9, in <module>
    from . import forms
  File "\lib\site-packages\django_measurement\forms.py", line 8, in <module>
    from django_measurement.conf import settings
  File "\lib\site-packages\django_measurement\conf.py", line 2, in <module>
    from appconf import AppConf
  File "\lib\site-packages\appconf\__init__.py", line 2, in <module>
    from .base import AppConf  
File "\lib\site-packages\appconf\base.py", line 4, in <module>
    from django.utils import six
ImportError: cannot import name 'six' from 'django.utils' (\lib\site-packages\django\utils\__init__.py)
codingjoe commented 3 years ago

Hi @raf-uwt,

That is odd, we dropped six a while ago. Would you mind sharing which version of this package you are using?

Best, Joe

raf-uwt commented 3 years ago

Hi Joe, Thanks for replying back, currently we are using version django-measurement==3.1.1 and Django==2.1.3 for which the app works great. But we wanted to update Django to latest version 3.1.7, so we got the error message related to SIX, so we decided to update django-measurement app to its latest version 3.2.3 but we are still getting the same error.

Thanks

codingjoe commented 3 years ago

Hi @raf-uwt, After going through the stack trace you provided, the error is a dependency we use call django-appconf. You seem to be using an ancient version of that package. The newer versions no longer use six. Best, Joe

raf-uwt commented 3 years ago

You were right, thanks for taking me to the right direction. The app is working Ok after proper upgrades.