Bottom Page

Thread Rating:
  • 4 Vote(s) - 3 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Changing Python Versions in Ubuntu 16.04
I have three versions of Python on my laptop. They are Python 2.75, Python 3.5.2, and Python 3.6.2.

When I invoke the command

Python -V

I get the Python 2.75 version. That was fine in the past. Now I want to invoke Python -V and get the latest version Python 3.6.2.

Also, when I run jupyter notebook,it uses Python 2.75. I want it to use Python 3.6.2 instead.How do I change that?

I believe that these are really the same question.By changing Python -V to Python 3.6.2, I will have changed the default
Python interpreter to Python 3.6.2 in jupyter notebook.

Any help appreciated. Thanks in advance.


This is a snap if you use pyenv.
See this tutorial:

and for Anaconda installation see:
you can make an alias.
metulburr@ubuntu:~$ python -V
Python 2.7.12
metulburr@ubuntu:~$ echo "alias python='python3'" >> .bashrc
metulburr@ubuntu:~$ bash
metulburr@ubuntu:~$ python -V
Python 3.7.2
You can change python3 to whatever version you want to invoke. bash to reset the terminal. Or just open a new terminal.

This may or may not change jupyter notebook. If not, then you will have to go into its settings and change python to python3.6 for it to invoke that version. All IDE's have a method to change which python version it invokes.

Top Page

Possibly Related Threads...
Thread Author Replies Views Last Post
  Changing a character in a string Livne_ye 4 108 Mar-13-2019, 12:39 PM
Last Post: Larz60+
  A crucial question on coexistence of Py2-Py3 under Ubuntu distro samsonite 7 130 Mar-07-2019, 03:34 PM
Last Post: samsonite
  Global variables not changing ThemePark 3 136 Mar-02-2019, 11:24 AM
Last Post: Larz60+
  Pixiedust install in Ubuntu ErnestTBass 0 76 Feb-20-2019, 04:40 AM
Last Post: ErnestTBass
  randint stops changing values in a loop Naito 4 180 Jan-30-2019, 08:15 AM
Last Post: perfringo
  Changing Directory; Syntax Error DavidRobinsons 1 290 Oct-08-2018, 02:13 AM
Last Post: ichabod801
  Newbie Ubuntu script problem Kloontor 6 323 Sep-24-2018, 03:51 PM
Last Post: Kloontor
  pipenv install command getting errors on WSL/Ubuntu sheridanrea 0 424 Sep-14-2018, 06:40 AM
Last Post: sheridanrea
  Installing pygal under Ubuntu 18.04 ybeco 25 1,571 Aug-11-2018, 06:15 AM
Last Post: Gribouillis
  [SOLVED] Changing a string to an int Panda 3 705 Jun-23-2018, 08:12 PM
Last Post: gontajones

Forum Jump:

Users browsing this thread: 1 Guest(s)