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
Setting path at Unix/Linux In the csh shell − type setenv PATH "$PATH:/usr/local/bin/python" and press Enter. In the bash shell (Linux) − type export PATH="$PATH:/usr/local/bin/python" and press Enter. In the sh or ksh shell − type PATH="$PATH:/usr/local/bin/python" and press Enter.
Setting Path in Unix or Linux In the csh shell, type the following sentence: PATH “$PATH:/usr/local/bin/python” and press Enter. If you are using the standard flavour of Linux, open up the bash shell and type the following phrase, export PATH=”$PATH:/usr/local/bin/python” and press Enter.
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.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With