2021年11月11日 星期四

How to make 'python' program command execute Python 3?

/usr/bin/env: ‘python’: No such file or directory

 

Method 1: (This method is failed to "#! /usr/bin/env")

   putting alias in the user's ~/.bashrc

   example:

   alias python=python3


Method 2: (This method is OK to "#! /usr/bin/env")

  $ whereis python3

  $ ls -lisa /usr/bin/python*

  $ sudo ln -s /usr/bin/python3 /usr/bin/python


Method 3:

  $ sudo apt install python-is-python3