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

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

Open
piyushjoshi1016 opened this issue Apr 30, 2024 · 1 comment

Comments

@piyushjoshi1016
Copy link

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.

@smirolo
Copy link
Contributor

smirolo commented May 1, 2024

Some 3rd party prerequisites do not support Django 4.2 yet. We managed to gracefully remove features when you are running with Django4.2. We haven't had a chance to look into Django5 support yet. Python 3.11 should not be an issue. Thank you for the patience.

In the meantime I would use pip install -r requirements.txt as recommended in the install steps.

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

No branches or pull requests

2 participants