.
2021-06-20
Useful set of terminal commands for when using virtualenvs in Python. These cover about 99% of my use of venvs.
python3 -m venv venv
(2nd argument specifies name of venv)
Note, you can specify python version like so:
virtualenv venv -p python3.6
source venv/bin/activate
pip install -r requirements.txt
pip install pandas
pip freeze > requirements.txt
python -m ipykernel install --user --name=<<env-name>>
Note the above makes the kernel available regardless of what environment you run jupyter notebook
in.
deactivate
jupyter kernelspec list
jupyter kernelspec remove <<env-name>>