1

I am using Ubuntu 16.04 LTS. I installed python 3.6 using sudo apt-get python 3.6. But python 3.5 is still installed. How do I remove 3.5 and set 3.6 as default in place of it so that when I type python3 --version in terminal it shows 3.6.5 instead of 3.5.2

Tanmay Bhatnagar
  • 2,330
  • 4
  • 30
  • 50
  • Important applications are depending on python3.5 . About your typing `python3` : Better = `python36`, or whatever the alien python3.6 provides. – Knud Larsen Jun 17 '18 at 12:41

1 Answers1

7

The Ubuntu 16.04 distribution comes with Python 3.5.1. Many system apps depend on this default python package. Removing it will break those system apps. Overwriting it with a different python will screw up updates. So don't remove it!

Instead make a virtual environment to run python3.6 as your user's default python and allowing it to co-exist with the system's python3.5.1.

unutbu
  • 842,883
  • 184
  • 1,785
  • 1,677
  • I want to use python 3.6 in my jupyter notebook. It does not show up in the kernel selector. How do I add it? I am using pip – Tanmay Bhatnagar Jun 17 '18 at 14:02
  • 1
    `jupyter` itself is a python program. It sounds like your `jupyter` is installed in the python3.5 distribution, but not for the python3.6 distribution. `pip` is also a python program. There is usually one pip for each distribution. To install a program for a certain distribution, you need to run the associated pip. The pip executable is usually in the same directory as the associated python executable. So (ideally, activate your python3.6 virtual environment and then) [`run /path/to/python3.6 -m pip install jupyter`](http://jupyter.org/install). – unutbu Jun 17 '18 at 15:08
  • If you make a python3.6 virtual environment and activate it, then python3.6 will become your default `python`, so you can just run `python -m pip install jupyter`. – unutbu Jun 17 '18 at 15:16
  • I have already installed jupyter I just want to add the py3.6 kernel – Tanmay Bhatnagar Jun 17 '18 at 15:17
  • 1
    See [How do I add python3 kernel to jupyter (IPython)](https://stackoverflow.com/q/28831854/190597). – unutbu Jun 17 '18 at 15:21