sudo apt-get install python3-pip
sudo pip3 install virtualenv
virtualenv venv
you can use any name insted of venv
virtualenv -p /usr/bin/python2.7 venv
source venv/bin/activate
source venv/bin/activate.fish
deactivate
virtualenv -p python3 myenv
python3 -m venv myenv
My experience is opposite. I tried
sudo apt-get install virtualenv
but sometimes it could not find packages installed in the virtual environment.pip3 install virtualenv
worked as expected. Ubuntu 18.04.