Bottom Page

Thread Rating:
  • 4 Vote(s) - 3 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Changing Python Versions in Ubuntu 16.04
#1
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.

R,


ErnestTBass
Quote
#2
This is a snap if you use pyenv.
See this tutorial: https://python-forum.io/Thread-Part-1-Li...3#pid18603

and for Anaconda installation see: https://python-forum.io/Thread-Anaconda-...ight=pyenv
Quote
#3
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.
Quote

Top Page

Possibly Related Threads...
Thread Author Replies Views Last Post
  Changing Directory; Syntax Error DavidRobinsons 1 215 Oct-08-2018, 02:13 AM
Last Post: ichabod801
  Newbie Ubuntu script problem Kloontor 6 240 Sep-24-2018, 03:51 PM
Last Post: Kloontor
  pipenv install command getting errors on WSL/Ubuntu sheridanrea 0 314 Sep-14-2018, 06:40 AM
Last Post: sheridanrea
  Installing pygal under Ubuntu 18.04 ybeco 25 1,247 Aug-11-2018, 06:15 AM
Last Post: Gribouillis
  [SOLVED] Changing a string to an int Panda 3 598 Jun-23-2018, 08:12 PM
Last Post: gontajones
  Changing User Input Strings Into Set Integer Values Mario128843 3 440 May-01-2018, 03:32 AM
Last Post: Mario128843
  Randomly changing numbers NicoConti 4 545 Mar-27-2018, 03:07 PM
Last Post: NicoConti
  File system navigation. Changing directory GregoireLeGros 3 528 Mar-20-2018, 06:33 PM
Last Post: GregoireLeGros
  Ubuntu: Error installing watson-developer-cloud Python module gio123 3 990 Mar-15-2018, 09:39 PM
Last Post: gio123
  changing characters in multiple strings in a list newmanf 3 387 Feb-23-2018, 06:23 PM
Last Post: newmanf

Forum Jump:


Users browsing this thread: 1 Guest(s)