0

I have python version 3.8.0 and the .exe is added to the path but I am trying to create a django project and need to use py -m venv command to create a virtual environment but it says py is not recognized as an internal or external command, operable program or batch file.

Varun Deokar
  • 21
  • 1
  • 5
  • https://docs.python.org/3/using/windows.html#launcher – iklinac Aug 24 '20 at 10:47
  • https://stackoverflow.com/questions/30794342/python-windows-where-is-the-python-launcher – iklinac Aug 24 '20 at 10:50
  • 1
    When you say `the .exe is added to the path`, that's not what you're supposed to do! You don't add any files to `%PATH%`, only directories, so you're supposed to add the full path to the directory which contains `py.exe`, i.e its parent. – Compo Aug 24 '20 at 12:30

2 Answers2

0

Use: python3 -m venv /path/to/new/virtual/environment ( more on virtualenv you will find there: https://docs.python.org/3/library/venv.html)

icecube
  • 111
  • 2
  • 16
0

Since the "python" command is working, your "python.exe" was added to PATH correctly. However, the "py" command is actually using C:\Windows\py.exe to be functioned. Therefore, you need to add

C:\Windows\

to PATH as well, to make the command "py" work as "python".

fyqc
  • 121
  • 1
  • 5