How to change the python version to ubuntu

I installed ubuntu, as I understood it, along with python2. 7 installed in the folder /home/user/. local/lib I installed python3. 5 after which I download all sorts of libraries via pip, in particular scipy, and it is installed in the folder python2.7, and I do not use the 2nd version of python.

Help me either remove python 2.7, or prioritize 3.5. I can't find enough information in Google to solve it.

Author: Vorobey.A, 2017-03-06

3 answers

Use pip3 or python3 -m pip to run pip for Python 3

$ pip3 --version
pip 9.0.1 from /home/r033/.local/lib/python3.5/site-packages (python 3.5)
$ python3 -m pip --version
pip 9.0.1 from /home/r033/.local/lib/python3.5/site-packages (python 3.5)

You can also install the libraries through the Ubuntu repositories, if they are there.

sudo apt install python3-scipy
 3
Author: Александр Лоев merge me, 2017-03-07 12:09:39

Try running pip like this:

sudo python3 -m pip

P.S. A scipy for python3 in ubuntu can be put like this:

sudo apt-get install python3-scipy
 2
Author: Andrio Skur, 2017-03-07 11:58:06

If I understand you correctly, it will help you:

sudo ln -sf python3 /usr/bin/python

This command will replace the python reference in /usr/bin

After that, when python starts, the python3 interpreter will open

 -4
Author: Narnik Gamarnik, 2017-03-06 23:15:37