user1551817
user1551817

Reputation: 7461

Upgrading to python 3.x on Ubuntu 18.04

I have Ubuntu 18.04. I want to upgrade to python 3.x

When I do:

python --version

I get:

Python 2.7.17

But then I run:

sudo apt-get install python3

it says:

python3 is already the newest version (3.6.7-1~18.04).

I guess this means that I have more than one version of python on my laptop? What's the best way for me to clean this up? Should I delete one? I made a bit of a mess installing / uninstalling anaconda / miniconda at various points in my life, and so that has probably not helped.

I just want to have a clean install of python 3, and then I will reinstall miniconda after.

Upvotes: 0

Views: 2495

Answers (1)

polybius
polybius

Reputation: 61

To run Python 3 instead of Python 2 type:

python3

If you want Python 3 to run by default you can add the following to the aliases section of your .bashrc:

# some more ls aliases
alias python='python3'

To update Python3:

sudo apt upgrade python3

Upvotes: 3

Related Questions