How I can upgrade my Ubuntu python3.7 to python3.8 latest version?

Question:

I am tried by this command

sudo pip3 install --upgrade python

but still, it did not work.

Asked By: Shiva_Adasule

||

Answers:

pip is not capable of upgrading python – it is for python packages. Use,

sudo add-apt-repository ppa:deadsnakes/ppa
sudo apt-get update
sudo apt-get install python3.8

On Ubuntu. You may also want -dev and -venv:

sudo apt-get install python3.8-venv python3.8-dev

To ensure you have 3.8 pip, virtualenv, and such.

Answered By: modesitt

Try this:

sudo apt-get update

sudo apt-get install python3.8

And if you want to replace the 3.7 with 3.8 for the python3 on your computer use the following after running the above commands.

sudo update-alternatives --install /usr/bin/python3 python3 /usr/bin/python3.7 1

sudo update-alternatives --install /usr/bin/python3 python3 /usr/bin/python3.8 2

You can switch between python versions on your computer by running the following command.
This will show you the installed versions and you can select which one you want to use.

sudo update-alternatives --config python3
Answered By: Yepram Yeransian

Try this

sudo apt --fix-missing purge $(dpkg -l | grep 'python3.7' | awk '{print $2}')

then run

sudo apt upgrade
Answered By: Vikas Mehta
Categories: questions Tags: , ,
Answers are sorted by their score. The answer accepted by the question owner as the best is marked with
at the top-right corner.