My system is RedHat 5 Linux and has default python 2.4 installed. In order to execute Mercurial 1.81, I tried to upgrade python from 2.4 to 2.6 and I thought I saved it in a different directory. I have put hard link from python 2.6 to python. Now, I removed it and hope to make python pointing back to python 2.4 in order to avoid version conflicting.
Here is the command I have used to remove the hard link between python and python 2.6:
find -xdev -samefile /usr/bin/python | xargs rm
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
PYTHONHOME=/usr/lib/python2.6
PYTHONPATH=/usr/lib/python2.6
Then when I typed whereis python
, here are the results.
/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 to be 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 :
- How can I change the replace the results from the on-liner above to python 2.6 ?
- Why cannot I find a directory such as
/usr/bin/python2.6
or/usr/local/bin/python2.6
? Does it mean I installed my python 2.6 incorrectly or accidentally removed the directory ? Is anything wrong about the results I got from those commands I entered ? - Any idea how to make the system execute python 2.6 when I used "hg push" ?
- Should I install the python 2.6 again at /usr/local/bin ?
hg push --insecure
to let Mercurial know that you cannot verify the certificates with your Python. I think you can also configure a host fingerprint, see the wiki page.