ssnegi
ssnegi

Reputation: 183

How to set the python path in Centos Linux

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

Upvotes: 7

Views: 35501

Answers (1)

Dropout
Dropout

Reputation: 13866

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.

Upvotes: 11

Related Questions