I am using this command:
python -m virtualenv venv
and this is what comes out:
C:\Users\dell\AppData\Local\Programs\Python\Python310\python.exe: No module named virtualenv`
I am using this command:
python -m virtualenv venv
and this is what comes out:
C:\Users\dell\AppData\Local\Programs\Python\Python310\python.exe: No module named virtualenv`
as Serge mentioned in the comments, your command is incorrect. Instead it should be: python3 -m venv /path/to/new/virtual/environment
see this for more info https://docs.python.org/3/library/venv.html
Are you using Python3 or Python2?
If Python2, use the virtualenv
command. You'll first need to install e.g. py -m pip install --user virtualenv
. Then you can create the environment: py -m virtualenv myenv
(where 'myenv' can be any name you want to call the environment). Then you can activate it using: source myenv/bin/activate
.
If you are using Python3, use the venv
command instead. I'm not a Windows user, but I don't think you have to install if using Python3, so you can go straight to creating the environment).
Create the environment using:
py -m venv myenv
(again, 'myenv' can be renamed).
Then you activate the environment in the same way as above (source myenv/bin/activate
).
This Python documentation (https://packaging.python.org/en/latest/guides/installing-using-pip-and-virtual-environments/) explains in detail.