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
For Ubuntu 16.04, Python 2.7, I recommend
sudo apt-get install virtualenv
instead of installing packagepython-pip
, which seems flawed. pip from python-pip package cannot even dopip freeze
without crashing. This happens on a fresh Ubuntu 16.04 Desktop install so quite surprising.