Home > Mobile >  Why I can't install python virtual environment?
Why I can't install python virtual environment?

Time:06-22

I try to install virtual environment using : python -m venv .venv

But it says it can't find a module called venv.

enter image description here

CodePudding user response:

I have a feeling that you are using the default Python version 2.X. Try this to see if that is the case:

python --version

If the default is 2.X, then it does not come with the venv library. You need to explicitly call python3:

python3 -m venv .venv

CodePudding user response:

Execute first this line to install virtual-enviornment and than execute your line.

python -m pip install virtualenv
  • Related