1

Ubuntu (older than 20.04 LTS) ships with Python 3 and python 2 both. When python was typed in terminal, python2.7 opens and to open python 3.6, python3 command is needed. However python3.6 also works.

So my doubt is why python3 and python3.6 both work? Technically since I have python3.6 installed, only python3.6 should work. But then why python3 works as well?

EDIT 1

When I type python and press tabs twice (which shows possible commands), I see python3 and python3.8 both.

My doubt is what is the difference between the python3 command and python3.6 command in their execution.

2
  • it is still installed though after upgrade
    – pLumo
    May 9, 2020 at 16:01
  • @user535733 how is this relevant to my question? May 9, 2020 at 16:03

1 Answer 1

3

The python3 command is a link to whatever version of Py3 the system is currently using.

This is very handy so scripts don't need to keep track of the exact version installed and don't break at the next release-upgrade.

4
  • Where can I check other links which other apps have? May 9, 2020 at 16:01
  • @AbhayPatil your question is vague. It's not clear what you are asking. Can you provide a non-Python3 example?
    – user535733
    May 9, 2020 at 16:11
  • Just like python, do other apps also use such links? May 9, 2020 at 16:13
  • Sure - look through /bin, /sbin. and the other directories in your $PATH. Example: ls -l /usr/bin and you will see a few
    – user535733
    May 9, 2020 at 16:14

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.