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 format to Int Scott 3 156 Today, 06:33 AM
Last Post: ODIS
  Python 2.7 and Ubuntu 19.04? ProDigit 2 192 May-25-2019, 12:03 PM
Last Post: snippsat
  Changing Number Format moby 4 133 May-24-2019, 11:04 PM
Last Post: snippsat
  How to get separate versions? noodlesnoah 3 83 May-23-2019, 06:24 PM
Last Post: snippsat
  changing { and } in str.format() Skaperen 10 345 May-16-2019, 05:07 AM
Last Post: Skaperen
  Truncated email attachments on Ubuntu 16 (Xenial) morphex 1 99 May-08-2019, 07:03 PM
Last Post: micseydel
  Is there a way to automate changing the lines in a .txt like this? ejected 3 183 May-05-2019, 11:50 PM
Last Post: Skaperen
  unable to pass a input after changing the user from root to non root using python avinash 3 175 Apr-08-2019, 10:05 AM
Last Post: avinash
  Changing a character in a string Livne_ye 4 196 Mar-13-2019, 12:39 PM
Last Post: Larz60+
  A crucial question on coexistence of Py2-Py3 under Ubuntu distro samsonite 7 224 Mar-07-2019, 03:34 PM
Last Post: samsonite

Forum Jump:


Users browsing this thread: 1 Guest(s)