Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
379 views
in Technique[技术] by (71.8m points)

python - 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:UsersmeAppDataLocalProgramsPythonPython38

Path includes: C:UsersmeAppDataLocalProgramsPythonPython38Scripts
and C:UsersmeAppDataLocalProgramsPythonPython38

Any remedies to this issue, thank you all.

question from:https://stackoverflow.com/questions/65909146/python3-m-venv-venv-error-winerror-2

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

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.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...