How to quickly create a virtual env for Python on Linux:
-
sudo apt install python3-pip to be sure that pip is installed.
-
pip3 install virtualenv to install virtualenv package.
-
mkdir ~/some_project to create a folder some_project in home directory.
-
cd ~/some_project to enter that folder.
-
virtualenv -p python3 venv to create a virtual environment directory venv with Python 3 as the interpreter.
-
source ~/some_project/venv/bin/activate to activate the virtual environment
Other commands:
deactivate to stop the virtual env.
rm ~/some_project to remove the virtual env.
More detailed info:
https://virtualenv.pypa.io/en/stable/userguide/