1

As the title shows, I get an error when attempting to run python3 -m venv .venv: Error: [WinError 2] The system cannot find the file specified. I am running the command in Bash on Windows. I have python version 3.8.7.

I tried copying "python.exe" to also have "python3.exe" which may be worth noting.

Python is installed here: C:\Users\me\AppData\Local\Programs\Python\Python38

Path includes: C:\Users\me\AppData\Local\Programs\Python\Python38\Scripts
and C:\Users\me\AppData\Local\Programs\Python\Python38\

Any remedies to this issue, thank you all.

Austin L
  • 336
  • 1
  • 17
  • To be sure you exactly run python that you want, use python path instead of `python3` command which is in your case `"C:\Users\me\AppData\Local\Programs\Python\Python38\Scripts\python.exe"` – Ali Alnadous Jan 26 '21 at 21:20
  • that does work, but why wouldnt windows honor my path for the python3 command? Thanks – Austin L Jan 27 '21 at 17:27

1 Answers1

1

Since you are working with windows, you can specify python version with python absolute path as mentioned previously or with python launcher (which is installed with python) with py command.

you can list installed python versions with py -0 then you can get output similar to this:

Installed Pythons found by py Launcher for Windows
 -3.9-64 *
 -3.8-32
 -3.7-64
 -3.6-64
 -2.7-64

Then you can specify python version you want by typing it as listed.

python3 command is almost used in linux os which have installed python 2.x so python refer to python 2.x and python3 refers to python 3.x.

More information i found from this answer post Link.

Ali Alnadous
  • 314
  • 2
  • 9
  • Thank you for the answer. If on windows all i have is python 3.8, can i have the alias of python3 work like it would on linux for interoperability? – Austin L Jan 28 '21 at 20:05
  • 1
    Just rename `python.exe` to python3.exe` as you mentioned , if you get an error try run `where.exe python3` and it will show the path python3 runs from, it should tell you only that specified path and if there are more than one path you should keep the only what you want. – Ali Alnadous Jan 28 '21 at 21:28