Dhaval Vaghela
Dhaval Vaghela

Reputation: 450

Django command - django-admin command not working

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.

Upvotes: 5

Views: 1241

Answers (2)

JelloSquirrel
JelloSquirrel

Reputation: 89

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"

Upvotes: 2

Zahra Nasrollahi
Zahra Nasrollahi

Reputation: 1

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

Upvotes: 0

Related Questions