-1

I tried to install the python 2.7.3 on Linux box and then created alias in my local .bash_profile as below:

alias python='/opt/python2.7.3/bin/python'
alias python2.7.3='/opt/python2.7.3/bin/python'

PATH=$PATH:$HOME/bin:/opt/python2.7.3/bin

then run the command source .bash_profile to flush out all the update. but later I found the path was actually wrong and tried to correct it to the right one:

alias python='/opt/python2.7.3/bin/python2.7'    
PATH=$PATH:$HOME/bin:/opt/python2.7.3/bin/python2.7

but when I export the path, it still has the wrong directory included though it does have the right one appended to the end. how I can get rid of the wrong directory from path totally?

2
  • 1
    try to set the path in /etc/environment file and then log out and log in. Nov 26, 2012 at 19:45
  • 1
    I'm a little surprised that you would want /opt/python2.7.3/bin/python2.7 in your $PATH. $PATH should only contain directories.
    – Iguananaut
    Nov 26, 2012 at 19:48

1 Answer 1

1

$PATH should contain directories, not a paths to binary files.

PATH=$PATH:$HOME/bin:/opt/python2.7.3/bin/

You must log in to answer this question.