5

i have tried to install django using below three command. Now when i execute the django-amdin command then its showing me below error. Even i cant see the django-admin --version.

sudo apt install python3.8
sudo apt-get install python3-pip
pip3 install Django ( Its successfully installed )
Now when i execute any command related to django-admin then its showing below error:

Error is : 
Traceback (most recent call last):
  File "/home/dev/.local/bin/django-admin", line 7, in <module>
    from django.core.management import execute_from_command_line
  File "/home/dev/.local/lib/python3.5/site-packages/django/core/management/__init__.py", line 13, in <module>
    from django.apps import apps
  File "/home/dev/.local/lib/python3.5/site-packages/django/apps/__init__.py", line 1, in <module>
    from .config import AppConfig
  File "/home/dev/.local/lib/python3.5/site-packages/django/apps/config.py", line 7, in <module>
    from django.utils.deprecation import RemovedInDjango41Warning
  File "/home/dev/.local/lib/python3.5/site-packages/django/utils/deprecation.py", line 5, in <module>
    from asgiref.sync import sync_to_async
  File "/home/dev/.local/lib/python3.5/site-packages/asgiref/sync.py", line 114
    launch_map: "Dict[asyncio.Task[object], threading.Thread]" = {}
              ^
SyntaxError: invalid syntax

Please help here if anyone have an idea.

7
  • Your command shows you install python3.8 but you are running python3.5. Apr 17, 2021 at 12:49
  • yes , i have used the command python3.8 but its installed 3.5. Its also showing me Python 3.5.2. Apr 17, 2021 at 12:53
  • so what i need to do here. Manage.py not available because when i execute django-admin startapp then its showing me same error while used the django-admin. Apr 17, 2021 at 12:57
  • Try python3.8 django-admin.py ..... Apr 17, 2021 at 12:59
  • its showing me this one error : ModuleNotFoundError: No module named 'django Apr 17, 2021 at 13:01

2 Answers 2

2

I found an answer to this question since I had the same problem, my Django version required python 3.6+. I don't know how he found that out but it solved it for me.

link to answer by commenter Siddhartha Dutta

"Python 3.5.6 will not work, you will need at least Python3.6+ in your virtual environment, for this Django version. – Siddhartha Dutta May 25 at 14:21"

1
0

you can uninstall asgiref first: python3 -m pip uninstall asgiref and install django again: python3 -m pip install django

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.