Adding python to /usr/bin/env python variable

6,172

If you're using bash (which you probably are in a default Ubuntu install) you need to use export to set an environment variable on the command line.

export PATH=$PATH:/usr/bin

See @chaos's comment as well. Make sure env is showing your proper $PATH, eg:

bash-3.2$ env | grep PATH
PATH=/usr/bin:/bin:/usr/sbin:/sbin
bash-3.2$ echo $PATH
/usr/bin:/bin:/usr/sbin:/sbin
Share:
6,172
anonymous
Author by

anonymous

Updated on September 18, 2022

Comments

  • anonymous
    anonymous over 1 year

    The #!/usr/bin/env python hashbang isn't working on my Ubuntu install.

    I tried the following:

    root@x# python=/usr/bin/python
    root@x# PATH=$PATH:/usr/bin/python
    
    • chaos
      chaos over 9 years
      Can you please post the output of env | grep PATH and env python --version and which python?
    • user9517
      user9517 over 9 years
      It's not clear exactly what's not working.