How to set the python path in Centos Linux

26,730

You need to add python to your $PATH environment variable. You can use the following command:

export PATH=$PATH:/usr/local/bin/python

This will append the /usr/local/bin/python to the existing $PATH. It is necessary to reopen the shell window afterwards.

Share:
26,730
ssnegi
Author by

ssnegi

Updated on February 02, 2020

Comments

  • ssnegi
    ssnegi about 4 years

    I am new to python and trying to install it on my centos server . By default there was 2.6 version which I deleted and installed the new version 2.7.x ...

    But I am facing problem . when I type the below command it gives me the message

    python --version
    -bash: python: command not found
    

    I can see that python is installed in /usr/local/bin .. How can I set the path so I may run the above command and it gives me the correct version..

    Please help