Skip to content

Instantly share code, notes, and snippets.

@takurx
Last active December 21, 2022 15:49
Show Gist options
  • Star 2 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save takurx/57342618e21b3c1afdf841956cc23da4 to your computer and use it in GitHub Desktop.
Save takurx/57342618e21b3c1afdf841956cc23da4 to your computer and use it in GitHub Desktop.
On Ubuntu 20.04 it is status of python3 and python2.

0. Default

  • python
sharo@kirima:~$ python

Command 'python' not found, did you mean:

  command 'python3' from deb python3
  command 'python' from deb python-is-python3

  • python3
sharo@kirima:~$ python3
Python 3.8.2 (default, Apr 27 2020, 15:53:34) 
[GCC 9.3.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>>
  • python2
sharo@kirima:~$ python2

Command 'python2' not found, but can be installed with:

sudo apt install python2

1. sudo apt install python-is-python3

  • python
sharo@kirima:~$ sudo apt install python-is-python3
sharo@kirima:~$ python
Python 3.8.2 (default, Apr 27 2020, 15:53:34) 
[GCC 9.3.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> 
  • python2
sharo@kirima:~$ python2

Command 'python2' not found, but can be installed with:

sudo apt install python2

2. sudo apt remove python-is-python3

  • python
sharo@kirima:~$ python
bash: /usr/bin/python: No such file or directory

3. sudo apt install python2

  • python
sharo@kirima:~$ python
bash: /usr/bin/python: No such file or directory
  • python2
sharo@kirima:~$ python2
Python 2.7.18rc1 (default, Apr  7 2020, 12:05:55) 
[GCC 9.3.0] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment