How to make Mercurial find updated version of Python?updating Python from version 2.6.5 to 2.7 on Linux...

Is it possible to put a rectangle as background in the author section?

Non-trope happy ending?

Is it possible to have a strip of cold climate in the middle of a planet?

Closed-form expression for certain product

Fear of getting stuck on one programming language / technology that is not used in my country

Melting point of aspirin, contradicting sources

The screen of my macbook suddenly broken down how can I do to recover

Problem with TransformedDistribution

Is it improper etiquette to ask your opponent what his/her rating is before the game?

What if a revenant (monster) gains fire resistance?

Creature in Shazam mid-credits scene?

What should you do if you miss a job interview (deliberately)?

Does an advisor owe his/her student anything? Will an advisor keep a PhD student only out of pity?

How to explain what's wrong with this application of the chain rule?

Should I stop contributing to retirement accounts?

Drawing ramified coverings with tikz

Why does the Sun have different day lengths, but not the gas giants?

On a tidally locked planet, would time be quantized?

Not using 's' for he/she/it

Where does the bonus feat in the cleric starting package come from?

Question about the proof of Second Isomorphism Theorem

How should I respond when I lied about my education and the company finds out through background check?

Why electric field inside a cavity of a non-conducting sphere not zero?

Loading commands from file



How to make Mercurial find updated version of Python?


updating Python from version 2.6.5 to 2.7 on Linux server without reinstalling 3rd-party modulesAny way to (easily) upgrade Python in Ubuntu?Python version priority in OSX/UNIX PATH environment variablePython error In linuxDefault or fink python and lxml under 10.6.8Can't kill a sleeping processCentOS 5 Python - How To Force Specific Version?Confused about libraries libtorrent and Delugepip not working on hombrew python 2.7 installI get ValueError: zero length field name in format while i start prometheus-couchbase-exporter with Python 2.6













1















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.



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 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 :




  1. How can I change the replace the results from the on-liner above to python 2.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 python 2.6 incorrectly or accidentally removed the directory ? Is anything wrong about the results I got from those commands I entered ?

  3. Any idea how to make the system execute python 2.6 when I used "hg push" ?

  4. Should I install the python 2.6 again at /usr/local/bin ?










share|improve this question
















bumped to the homepage by Community 9 mins ago


This question has answers that may be good or bad; the system has marked it active so that they can be reviewed.
















  • You only need Python 2.4 to run any version of Mercurial, even Mercurial 2.1. Are you trying to use Python 2.6 to get better support for verifying SSL certificates?

    – Martin Geisler
    Mar 1 '12 at 23:03











  • When I used command such as "hg push", the system complained with an error message such as "abort: certificate checking requires Python 2.6 ". I assume that means it requires Python 2.6 or I am wrong ? Thanks

    – Cassie
    Mar 8 '12 at 17:13











  • Python 2.6 is required to check the SSL certificates. I'm a bit surprised it aborts, but you can try with 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.

    – Martin Geisler
    Mar 8 '12 at 17:23











  • Hi Thank you so very much ~. I tried "hg push --insecure".It avoided the certificates error and let me push successfully. Will there be any problem if I used hg push --insecure ?

    – Cassie
    Mar 9 '12 at 21:49











  • @Raystafarian Did you help edit the question posted ? Thank you very much,:)

    – Cassie
    Mar 9 '12 at 21:51


















1















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.



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 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 :




  1. How can I change the replace the results from the on-liner above to python 2.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 python 2.6 incorrectly or accidentally removed the directory ? Is anything wrong about the results I got from those commands I entered ?

  3. Any idea how to make the system execute python 2.6 when I used "hg push" ?

  4. Should I install the python 2.6 again at /usr/local/bin ?










share|improve this question
















bumped to the homepage by Community 9 mins ago


This question has answers that may be good or bad; the system has marked it active so that they can be reviewed.
















  • You only need Python 2.4 to run any version of Mercurial, even Mercurial 2.1. Are you trying to use Python 2.6 to get better support for verifying SSL certificates?

    – Martin Geisler
    Mar 1 '12 at 23:03











  • When I used command such as "hg push", the system complained with an error message such as "abort: certificate checking requires Python 2.6 ". I assume that means it requires Python 2.6 or I am wrong ? Thanks

    – Cassie
    Mar 8 '12 at 17:13











  • Python 2.6 is required to check the SSL certificates. I'm a bit surprised it aborts, but you can try with 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.

    – Martin Geisler
    Mar 8 '12 at 17:23











  • Hi Thank you so very much ~. I tried "hg push --insecure".It avoided the certificates error and let me push successfully. Will there be any problem if I used hg push --insecure ?

    – Cassie
    Mar 9 '12 at 21:49











  • @Raystafarian Did you help edit the question posted ? Thank you very much,:)

    – Cassie
    Mar 9 '12 at 21:51
















1












1








1








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.



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 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 :




  1. How can I change the replace the results from the on-liner above to python 2.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 python 2.6 incorrectly or accidentally removed the directory ? Is anything wrong about the results I got from those commands I entered ?

  3. Any idea how to make the system execute python 2.6 when I used "hg push" ?

  4. Should I install the python 2.6 again at /usr/local/bin ?










share|improve this question
















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.



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 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 :




  1. How can I change the replace the results from the on-liner above to python 2.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 python 2.6 incorrectly or accidentally removed the directory ? Is anything wrong about the results I got from those commands I entered ?

  3. Any idea how to make the system execute python 2.6 when I used "hg push" ?

  4. Should I install the python 2.6 again at /usr/local/bin ?







linux installation python redhat-enterprise-linux mercurial






share|improve this question















share|improve this question













share|improve this question




share|improve this question








edited Sep 17 '16 at 4:01









fixer1234

19k144982




19k144982










asked Mar 1 '12 at 20:24









CassieCassie

155




155





bumped to the homepage by Community 9 mins ago


This question has answers that may be good or bad; the system has marked it active so that they can be reviewed.







bumped to the homepage by Community 9 mins ago


This question has answers that may be good or bad; the system has marked it active so that they can be reviewed.















  • You only need Python 2.4 to run any version of Mercurial, even Mercurial 2.1. Are you trying to use Python 2.6 to get better support for verifying SSL certificates?

    – Martin Geisler
    Mar 1 '12 at 23:03











  • When I used command such as "hg push", the system complained with an error message such as "abort: certificate checking requires Python 2.6 ". I assume that means it requires Python 2.6 or I am wrong ? Thanks

    – Cassie
    Mar 8 '12 at 17:13











  • Python 2.6 is required to check the SSL certificates. I'm a bit surprised it aborts, but you can try with 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.

    – Martin Geisler
    Mar 8 '12 at 17:23











  • Hi Thank you so very much ~. I tried "hg push --insecure".It avoided the certificates error and let me push successfully. Will there be any problem if I used hg push --insecure ?

    – Cassie
    Mar 9 '12 at 21:49











  • @Raystafarian Did you help edit the question posted ? Thank you very much,:)

    – Cassie
    Mar 9 '12 at 21:51





















  • You only need Python 2.4 to run any version of Mercurial, even Mercurial 2.1. Are you trying to use Python 2.6 to get better support for verifying SSL certificates?

    – Martin Geisler
    Mar 1 '12 at 23:03











  • When I used command such as "hg push", the system complained with an error message such as "abort: certificate checking requires Python 2.6 ". I assume that means it requires Python 2.6 or I am wrong ? Thanks

    – Cassie
    Mar 8 '12 at 17:13











  • Python 2.6 is required to check the SSL certificates. I'm a bit surprised it aborts, but you can try with 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.

    – Martin Geisler
    Mar 8 '12 at 17:23











  • Hi Thank you so very much ~. I tried "hg push --insecure".It avoided the certificates error and let me push successfully. Will there be any problem if I used hg push --insecure ?

    – Cassie
    Mar 9 '12 at 21:49











  • @Raystafarian Did you help edit the question posted ? Thank you very much,:)

    – Cassie
    Mar 9 '12 at 21:51



















You only need Python 2.4 to run any version of Mercurial, even Mercurial 2.1. Are you trying to use Python 2.6 to get better support for verifying SSL certificates?

– Martin Geisler
Mar 1 '12 at 23:03





You only need Python 2.4 to run any version of Mercurial, even Mercurial 2.1. Are you trying to use Python 2.6 to get better support for verifying SSL certificates?

– Martin Geisler
Mar 1 '12 at 23:03













When I used command such as "hg push", the system complained with an error message such as "abort: certificate checking requires Python 2.6 ". I assume that means it requires Python 2.6 or I am wrong ? Thanks

– Cassie
Mar 8 '12 at 17:13





When I used command such as "hg push", the system complained with an error message such as "abort: certificate checking requires Python 2.6 ". I assume that means it requires Python 2.6 or I am wrong ? Thanks

– Cassie
Mar 8 '12 at 17:13













Python 2.6 is required to check the SSL certificates. I'm a bit surprised it aborts, but you can try with 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.

– Martin Geisler
Mar 8 '12 at 17:23





Python 2.6 is required to check the SSL certificates. I'm a bit surprised it aborts, but you can try with 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.

– Martin Geisler
Mar 8 '12 at 17:23













Hi Thank you so very much ~. I tried "hg push --insecure".It avoided the certificates error and let me push successfully. Will there be any problem if I used hg push --insecure ?

– Cassie
Mar 9 '12 at 21:49





Hi Thank you so very much ~. I tried "hg push --insecure".It avoided the certificates error and let me push successfully. Will there be any problem if I used hg push --insecure ?

– Cassie
Mar 9 '12 at 21:49













@Raystafarian Did you help edit the question posted ? Thank you very much,:)

– Cassie
Mar 9 '12 at 21:51







@Raystafarian Did you help edit the question posted ? Thank you very much,:)

– Cassie
Mar 9 '12 at 21:51












1 Answer
1






active

oldest

votes


















0















  1. Install virtualenv and virtualenvwrapper (easy_install worked for me, but don't forget to add the line source /usr/local/bin/virtualenvwrapper.sh to your shell startup script and then source the startup script to use the wrapper)

  2. Run mkvirtualenv -p /usr/lib/python2.6 ENVNAME (where ENVNAME is whatever you want to name it, maybe hg?)

  3. Add workon ENVNAME to your shell init script (.profile, .*shrc, etc)


Now your system will still be able to use 2.4, and all of your shells will use 2.6. Be careful, because this could break calls to other system-installed applications, if their dependencies aren't in your virtual environment. But, since you now have pip, it should be easy to pip install $WHATEVER_IS_MISSING (or run the deactivate command to drop out of your virtual environment, do your thing, and workon back to where you were).



If you find hg instances started by processes outside of shells (e.g. file manager integration?) then I recommend placing this small script on your path and configuring those processes to invoke it instead.



#!/bin/bash # or whatever your shell is
workon ENVNAME
hg $*


(Note, you can disable the (ENVNAME) prompt by setting VIRTUAL_ENV_DISABLE_PROMPT earlier in your init script than the workon line)






share|improve this answer























    Your Answer








    StackExchange.ready(function() {
    var channelOptions = {
    tags: "".split(" "),
    id: "3"
    };
    initTagRenderer("".split(" "), "".split(" "), channelOptions);

    StackExchange.using("externalEditor", function() {
    // Have to fire editor after snippets, if snippets enabled
    if (StackExchange.settings.snippets.snippetsEnabled) {
    StackExchange.using("snippets", function() {
    createEditor();
    });
    }
    else {
    createEditor();
    }
    });

    function createEditor() {
    StackExchange.prepareEditor({
    heartbeatType: 'answer',
    autoActivateHeartbeat: false,
    convertImagesToLinks: true,
    noModals: true,
    showLowRepImageUploadWarning: true,
    reputationToPostImages: 10,
    bindNavPrevention: true,
    postfix: "",
    imageUploader: {
    brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
    contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
    allowUrls: true
    },
    onDemand: true,
    discardSelector: ".discard-answer"
    ,immediatelyShowMarkdownHelp:true
    });


    }
    });














    draft saved

    draft discarded


















    StackExchange.ready(
    function () {
    StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fsuperuser.com%2fquestions%2f395920%2fhow-to-make-mercurial-find-updated-version-of-python%23new-answer', 'question_page');
    }
    );

    Post as a guest















    Required, but never shown

























    1 Answer
    1






    active

    oldest

    votes








    1 Answer
    1






    active

    oldest

    votes









    active

    oldest

    votes






    active

    oldest

    votes









    0















    1. Install virtualenv and virtualenvwrapper (easy_install worked for me, but don't forget to add the line source /usr/local/bin/virtualenvwrapper.sh to your shell startup script and then source the startup script to use the wrapper)

    2. Run mkvirtualenv -p /usr/lib/python2.6 ENVNAME (where ENVNAME is whatever you want to name it, maybe hg?)

    3. Add workon ENVNAME to your shell init script (.profile, .*shrc, etc)


    Now your system will still be able to use 2.4, and all of your shells will use 2.6. Be careful, because this could break calls to other system-installed applications, if their dependencies aren't in your virtual environment. But, since you now have pip, it should be easy to pip install $WHATEVER_IS_MISSING (or run the deactivate command to drop out of your virtual environment, do your thing, and workon back to where you were).



    If you find hg instances started by processes outside of shells (e.g. file manager integration?) then I recommend placing this small script on your path and configuring those processes to invoke it instead.



    #!/bin/bash # or whatever your shell is
    workon ENVNAME
    hg $*


    (Note, you can disable the (ENVNAME) prompt by setting VIRTUAL_ENV_DISABLE_PROMPT earlier in your init script than the workon line)






    share|improve this answer




























      0















      1. Install virtualenv and virtualenvwrapper (easy_install worked for me, but don't forget to add the line source /usr/local/bin/virtualenvwrapper.sh to your shell startup script and then source the startup script to use the wrapper)

      2. Run mkvirtualenv -p /usr/lib/python2.6 ENVNAME (where ENVNAME is whatever you want to name it, maybe hg?)

      3. Add workon ENVNAME to your shell init script (.profile, .*shrc, etc)


      Now your system will still be able to use 2.4, and all of your shells will use 2.6. Be careful, because this could break calls to other system-installed applications, if their dependencies aren't in your virtual environment. But, since you now have pip, it should be easy to pip install $WHATEVER_IS_MISSING (or run the deactivate command to drop out of your virtual environment, do your thing, and workon back to where you were).



      If you find hg instances started by processes outside of shells (e.g. file manager integration?) then I recommend placing this small script on your path and configuring those processes to invoke it instead.



      #!/bin/bash # or whatever your shell is
      workon ENVNAME
      hg $*


      (Note, you can disable the (ENVNAME) prompt by setting VIRTUAL_ENV_DISABLE_PROMPT earlier in your init script than the workon line)






      share|improve this answer


























        0












        0








        0








        1. Install virtualenv and virtualenvwrapper (easy_install worked for me, but don't forget to add the line source /usr/local/bin/virtualenvwrapper.sh to your shell startup script and then source the startup script to use the wrapper)

        2. Run mkvirtualenv -p /usr/lib/python2.6 ENVNAME (where ENVNAME is whatever you want to name it, maybe hg?)

        3. Add workon ENVNAME to your shell init script (.profile, .*shrc, etc)


        Now your system will still be able to use 2.4, and all of your shells will use 2.6. Be careful, because this could break calls to other system-installed applications, if their dependencies aren't in your virtual environment. But, since you now have pip, it should be easy to pip install $WHATEVER_IS_MISSING (or run the deactivate command to drop out of your virtual environment, do your thing, and workon back to where you were).



        If you find hg instances started by processes outside of shells (e.g. file manager integration?) then I recommend placing this small script on your path and configuring those processes to invoke it instead.



        #!/bin/bash # or whatever your shell is
        workon ENVNAME
        hg $*


        (Note, you can disable the (ENVNAME) prompt by setting VIRTUAL_ENV_DISABLE_PROMPT earlier in your init script than the workon line)






        share|improve this answer














        1. Install virtualenv and virtualenvwrapper (easy_install worked for me, but don't forget to add the line source /usr/local/bin/virtualenvwrapper.sh to your shell startup script and then source the startup script to use the wrapper)

        2. Run mkvirtualenv -p /usr/lib/python2.6 ENVNAME (where ENVNAME is whatever you want to name it, maybe hg?)

        3. Add workon ENVNAME to your shell init script (.profile, .*shrc, etc)


        Now your system will still be able to use 2.4, and all of your shells will use 2.6. Be careful, because this could break calls to other system-installed applications, if their dependencies aren't in your virtual environment. But, since you now have pip, it should be easy to pip install $WHATEVER_IS_MISSING (or run the deactivate command to drop out of your virtual environment, do your thing, and workon back to where you were).



        If you find hg instances started by processes outside of shells (e.g. file manager integration?) then I recommend placing this small script on your path and configuring those processes to invoke it instead.



        #!/bin/bash # or whatever your shell is
        workon ENVNAME
        hg $*


        (Note, you can disable the (ENVNAME) prompt by setting VIRTUAL_ENV_DISABLE_PROMPT earlier in your init script than the workon line)







        share|improve this answer












        share|improve this answer



        share|improve this answer










        answered Apr 26 '12 at 0:32









        Nate ParsonsNate Parsons

        78531226




        78531226






























            draft saved

            draft discarded




















































            Thanks for contributing an answer to Super User!


            • Please be sure to answer the question. Provide details and share your research!

            But avoid



            • Asking for help, clarification, or responding to other answers.

            • Making statements based on opinion; back them up with references or personal experience.


            To learn more, see our tips on writing great answers.




            draft saved


            draft discarded














            StackExchange.ready(
            function () {
            StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fsuperuser.com%2fquestions%2f395920%2fhow-to-make-mercurial-find-updated-version-of-python%23new-answer', 'question_page');
            }
            );

            Post as a guest















            Required, but never shown





















































            Required, but never shown














            Required, but never shown












            Required, but never shown







            Required, but never shown

































            Required, but never shown














            Required, but never shown












            Required, but never shown







            Required, but never shown







            Popular posts from this blog

            Why not use the yoke to control yaw, as well as pitch and roll? Announcing the arrival of...

            Couldn't open a raw socket. Error: Permission denied (13) (nmap)Is it possible to run networking commands...

            VNC viewer RFB protocol error: bad desktop size 0x0I Cannot Type the Key 'd' (lowercase) in VNC Viewer...