Skip to content

Facing import errors while testing with django 5.0.4. and Python 3.11.9. Is this competible with these versions? #232

Description

@piyushjoshi1016

Very first error I am receiving is this:

PS D:\products\securityForce\sf_backend> python .\manage.py runserver
Watching for file changes with StatReloader
Exception in thread django-main-thread:
Traceback (most recent call last):
File "C:\Users\joshi\AppData\Local\Programs\Python\Python311\Lib\threading.py", line 1045, in _bootstrap_inner
self.run()
File "C:\Users\joshi\AppData\Local\Programs\Python\Python311\Lib\threading.py", line 982, in run
self._target(*self.args, **self.kwargs)
File "C:\Users\joshi.virtualenvs\sf_backend-tETJSNuo\Lib\site-packages\django\utils\autoreload.py", line 64, in wrapper
fn(*args, **kwargs)
File "C:\Users\joshi.virtualenvs\sf_backend-tETJSNuo\Lib\site-packages\django\core\management\commands\runserver.py", line 125, in inner_run
autoreload.raise_last_exception()
File "C:\Users\joshi.virtualenvs\sf_backend-tETJSNuo\Lib\site-packages\django\utils\autoreload.py", line 87, in raise_last_exception
raise exception[1]
File "C:\Users\joshi.virtualenvs\sf_backend-tETJSNuo\Lib\site-packages\django\core\management_init
.py", line 394, in execute
autoreload.check_errors(django.setup)()
File "C:\Users\joshi.virtualenvs\sf_backend-tETJSNuo\Lib\site-packages\django\utils\autoreload.py", line 64, in wrapper
fn(*args, **kwargs)
File "C:\Users\joshi.virtualenvs\sf_backend-tETJSNuo\Lib\site-packages\django_init
.py", line 24, in setup
apps.populate(settings.INSTALLED_APPS)
File "C:\Users\joshi.virtualenvs\sf_backend-tETJSNuo\Lib\site-packages\django\apps\registry.py", line 116, in populate
app_config.import_models()
File "C:\Users\joshi.virtualenvs\sf_backend-tETJSNuo\Lib\site-packages\django\apps\config.py", line 269, in import_models
self.models_module = import_module(models_module_name)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\joshi\AppData\Local\Programs\Python\Python311\Lib\importlib_init
.py", line 126, in import_module
return _bootstrap._gcd_import(name[level:], package, level)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "", line 1204, in _gcd_import
File "", line 1176, in _find_and_load
File "", line 1147, in _find_and_load_unlocked
File "", line 690, in _load_unlocked
File "", line 940, in exec_module
File "", line 241, in _call_with_frames_removed
File "C:\Users\joshi.virtualenvs\sf_backend-tETJSNuo\Lib\site-packages\saas\models.py", line 81, in
from . import humanize, settings, signals
File "C:\Users\joshi.virtualenvs\sf_backend-tETJSNuo\Lib\site-packages\saas\humanize.py", line 33, in
from .utils import CurrencyDataLoader
File "C:\Users\joshi.virtualenvs\sf_backend-tETJSNuo\Lib\site-packages\saas\utils.py", line 34, in
from django.utils.timezone import utc, get_current_timezone
ImportError: cannot import name 'utc' from 'django.utils.timezone' (C:\Users\joshi.virtualenvs\sf_backend-tETJSNuo\Lib\site-packages\django\utils\timezone.py)
PS D:\products\securityForce\sf_backend> python --version
Python 3.11.9
PS D:\products\securityForce\sf_backend> django-admin --version
5.0.4
PS D:\products\securityForce\sf_backend>


After adding def utc(): function in django\utils\timezone.py file I gets another import error in site-packages\rest_framework\compact.py

Steps I followed:

  1. pip install djaodjin-saas
  2. pip install razorpay
  3. python manage.py runserver

I am using "pipenv" as a package manager.

Please tell me what's going wrong.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions