简体   繁体   中英

python3 -m venv .venv Error: [WinError 2]

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.

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 .

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM