My system is RedHat 5 Linux and has default python 2.4 installed. In order to execute Mercurial1.81, I tried to upgrade python from 2.4 to 2.6 and save it in different directory.
Here are the commands I have used:
find -xdev -samefile /usr/bin/python | xargs rm
I was trying to remove the hardlink used to link between python and python2.6. then I used commands as:
ln -s /usr/bin/python2.4 /usr/bin/python
ln -s /usr/bin/python2.6 /usr/local/bin/python
export PATH=/usr/local/bin:$PATH
Change first line of hg to #!/usr/bin/env python
PATHONHOME=/usr/lib/python2.6
PATHONPATH=/usr/lib/python2.6
Then when I typed "whereis python", here are the results.
python: /usr/bin/python2.4
/usr/bin/python
/usr/lib/python2.4
/usr/lib/python2.6
/usr/local/bin/python
/usr/include/python2.4
/usr/include/python2.6
/usr/share/man/man1/python.1.gz
Then when I typed "which python", it pointed to "usr/bin/python".When I typed "python -V", it showed "python 2.4.3". It seems pointing back to 2.4.3. Then when I used the command
python -c "import sys; print '\n' .join(sys.path)"
it showed
/usr/lib64/python24.zip
/usr/lib64/python2.4
/usr/lib64/python2.4/plat-linux2
/usr/lib64/python2.4/lib-tk
/usr/lib64/python2.4/lib-dynload
/usr/lib64/python2.4/site-packages
/usr/lib64/python2.4/site-packages/Numeric
/usr/lib64/python2.4/site-packages/gtk-2.0
/usr/lib/python2.4/site-packages
I tried to find the paths of python 2.6 by typing "find / -name python2.6", it showed
/usr/include/python2.6
/usr/lib/python2.6
/usr/lib64/python2.6
Here are my questions :
(1) How can I change the replace the results from the on-liner above to python2.6 ?
(2) Why cannot I find a directory such as /usr/bin/python2.6 or /usr/local/bin/python2.6 ?
Does it mean I installed my python2.6 wrong or accidentally remove the directory ?
Is anything wrong about the results I got from those commands I entered ?
(3) Any idea how to make the system execute python2.6 when I used "hg push" ?
(4)Should I install the python2.6 again at /usr/local/bin ?
Thank you very much,