xxxxxxxxxx
//to create the virtual environment in windows
python -m venv env
// or
python3 -m venv env
//to activate virtual environment in windows
source env/Scripts/activate
//to disable virtual environment in windows
deactivate
xxxxxxxxxx
### install library `virtualenv`
$ pip3 install virtualenv
### call module `venv` with the name for your environment
$ python3 -m venv venv_name
### activate the created environment
$ source venv_name/bin/activate #key step
### install the packages
(venv_name) user@host: pip3 install "package-name"
xxxxxxxxxx
//create the virtual environment for Mac and Linux
python -m venv env
// or
python3 -m venv env
//activate virtual environment for Mac and Linux
source env/bin/activate
xxxxxxxxxx
python3.8 -m pip install --user virtualenv
python3.8 -m virtualenv --help
xxxxxxxxxx
[server]$ pip3 install virtualenv
Collecting virtualenv
Downloading virtualenv-15.1.0-py2.py3-none-any.whl (1.8MB)
100% |████████████████████████████████| 1.8MB 367kB/s
Installing collected packages: virtualenv
Successfully installed virtualenv-15.1.0
well when you switch to the virtual environment. you should type
which python
and if it returns the path where your virtual environment exists then its okay you can directly run this command.
$ python setup.py build
$ python setup.py install
but if it gives the global level path which is not your virtualenv's path then you should try using
$ ~/.virtualenv/python-env/bin/python setup.py build
$ ~/.virtualenv/python-env/bin/python setup.py inst