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!
which python
in terminal and see if it returns/usr/bin/python
then dowhich python3
and see if it returns/usr/bin/python3
.. if so .. they are both installed .. my system has both .. if I want python3 .. I runpython3
command. – John Orion Mar 29 '18 at 19:12python --version
I getPython 2.7.12
returned and if I dopython3 --version
I getPython 3.5.2
returned ,,, not the "latest" but the latest for Ubuntu's install :D – John Orion Mar 29 '18 at 19:18apt
and many other things. You really don't want to mess your system up by removing one of these, setting them to an incorrect version (Python 2 and 3 are not compatible, one generally can't run scripts for the other without some adaption) or breaking them in any other way. Just search this site for questions of people who messed it up, you'll find many. Not few of them end with a system reinstall. – Byte Commander Mar 29 '18 at 19:27python3
withpython
command its safe to use this commandecho alias python=python3 >> ~/.bash && source ~/.bashrc
. Just do it and don't remove or symlink/usr/bin/python
at all! – Ali Razmdideh Mar 29 '18 at 19:31