0

I checked my system to see which Python is installed. I realized it was version 2.7.12. Than I downloaded the last version from Python.org which is 3.6.5. Now I have a tar.xz archive file that I extracted to somewhere (currently "Downloads" folder). Now what? What should I do? Which file should I double-click to install?

Note: I also tried sudo apt-get install python3 which seemed to do things (commands running in terminal like in Matrix) but at the end when I rechecked the Python version it was the old 2.7.12 version. Any suggestions?

2 Answers2

1

The One right way to install python3 is

sudo apt-get install python3

or

sudo apt install python3    

Whether you use apt or apt-get doesn't matter in this case; it is just a personal habit. apt is a front-end for apt-get but for this command there's no difference, so both are fine.

Once installed you have the new command python3.

Python is somehow special in that there are two major versions: python2 and python3. When you install or update (or call) python you'll get the python2 line.

Some time ago the Python developers decided to release a completely new version of Python with new features and new syntax. To not break existing programs, this new version is called python3. So it's completely safe (and usual) to have both python (V2) and python3 installed at the same time. Some of your existing programs will use python (V2) and some of them will use python3. The majority will currently use python (V2) (because they aren't rewritten yet to comply with python3's syntax), so do NOT uninstall python (V2).

See also How can I remove python 2.7 after installing python 3.3?. The question is five years old but still valid. The outcome is don't!

PerlDuck
  • 13,885
0

Since you have downloaded the source tar files, You have to use the configure, make and make install utilities. As demonstrated here. Change to the extracted directory run those commands. you may leave the --prefix part if you want to replace the system's current installed Python version.