1

When I tried to create Django project in virtual Environment, I am getting below Error,

C:\Users\new\Desktop\Desktop Files\Django Projects>activate myDjangoEnv

(myDjangoEnv) C:\Users\new\Desktop\Desktop Files\Django Projects>django-admi n startproject first_project Traceback (most recent call last): File "C:\Users\new\anaconda3\envs\myDjangoEnv\lib\site-packages\django\apps\config.py", line 7, in from django.utils.deprecation import RemovedInDjango41Warning File "C:\Users\new\anaconda3\envs\myDjangoEnv\lib\site-packages\django\utils\deprecation.py", line 5, in from asgiref.sync import sync_to_async

File "C:\Users\new\anaconda3\envs\myDjangoEnv\lib\site-packages\asgiref\sync.py", line 114 launch_map: "Dict[asyncio.Task[object], threading.Thread]" = {} ^ SyntaxError: invalid syntax

Please help me on this.Thanks in advance

raviteja.d
  • 11
  • 2
  • Which version of Python are you using? – Iain Shelvington May 15 '21 at 05:51
  • In my Local Python version is Python 3.9.1. In my Virtual Environment named mtDjangoEnv it is Python 3.5.6 (myDjangoEnv) C:\Users\new\Desktop\Desktop Files\Django Projects>python Python 3.5.6 |Anaconda, Inc.| (default, Aug 26 2018, 16:05:27) [MSC v.1900 64 bit (AMD64)] on win32 – raviteja.d May 17 '21 at 07:07
  • Python 3.5.6 will not work, you will need at least `Python3.6+` in your virtual environment, for this Django version. – Siddhartha May 25 '21 at 14:21

2 Answers2

0

1 Create a new virtual environment.

2 install the latest version of python and other packages.

3 install the latest version of Django

  • 1
    As it’s currently written, your answer is unclear. Please [edit] to add additional details that will help others understand how this addresses the question asked. You can find more information on how to write good answers [in the help center](/help/how-to-answer). – Community Dec 01 '21 at 11:10
0

If you are working on mac or linux you should add 4th step to https://stackoverflow.com/users/15373241/sahil-sharma's answer

1 Create a new virtual environment.

2 install the latest version of python and other packages.

3 install the latest version of Django

4 source activate yourDjangoEnvironment.

Please take a look about source activate in this previous question :)

Bertek
  • 9
  • 4
  • As it’s currently written, your answer is unclear. Please [edit] to add additional details that will help others understand how this addresses the question asked. You can find more information on how to write good answers [in the help center](/help/how-to-answer). – Community Oct 29 '22 at 18:23