I upgraded to Ubuntu 16.04. I know it came with only python 3 installed, but somehow python 2 got in there ( I guess as a dependency). That's ok because i would add it anyway. Both python versions are present as can be seen with:
$ python --version
Python 2.7.11+
$ python3 --version
Python 3.5.1+
My problem is that pip and pip3 both default to python3 (and there's no pip2 either). For example:
$ sudo -H pip install numpy
Requirement already satisfied (use --upgrade to upgrade): numpy in /usr/local/lib/python3.5/dist-packages
$ sudo -H pip3 install numpy
Requirement already satisfied (use --upgrade to upgrade): numpy in /usr/local/lib/python3.5/dist-packages
For what it's worth they are referring to different fodlers:
$ which pip
/usr/local/bin/pip
$ which pip3
/usr/local/bin/pip3
How do I make pip install to python2 and pip3 install to python3 like in Ubuntu 14.04?
Best Answer
after installing both
under Ubuntu 16.04 I can simply use
to install the desired module for Python2 or Python3, respectively.
I hope that is helpful and works for you, too!