virtualenvs
in home directory$ cd ~
$ mkdir virtualenvs
$ cd virtualenvs
python3 -m venv my_env
$ . my_env/bin/activate
(my_env) $
$ python -V
$ pip -V
$ python -m pip list
$ deactivate
$ python -m venv myenv
$ python3 -m venv myenv
# Python versions <= 3.3: venv not built-in
# Need to install virtualenv package first
$ virtualenv myenv
requirements.txt
file$ . ~/virtualenvs/my_env/bin/activate
(my_env) $ python -m pip freeze
Babel==2.9.1
pkg-resources==0.0.0
pytz==2021.1
(my_env) $ python -m pip freeze > requirements.txt
$ python -m pip install -r requirements.txt
venv
per projectvenv
s per projectvenv
for multiple projectsdocopt == 0.6.1 # must be version 0.6.1
keyring >= 4.1.1 # Minimum version 4.1.1
coverage != 3.5 # Anything except version 3.5
python -m pip install flask==0.9
python -m pip install 'Django<2.0' # mind the quotes!
# Upgrade to latest version
python -m pip install -U flask
# Upgrade pip itself
# Take care NOT to overwrite system pip
python -m pip install -U pip
Can tell Tox is being used by tox.ini
file
$ python -m pip install tox
tox.ini
$ cat tox.ini
$ tox