Switching between Python releases under Windows

Discussion in 'Python' started by Edward Diener, Mar 8, 2011.

  1. I have multiple versions of Python installed under Vista. Is there any
    easy way of switching between them so that invoking python and file
    associations for Python extensions files work automatically ?
     
    Edward Diener, Mar 8, 2011
    #1
    1. Advertising

  2. Edward Diener wrote:
    > I have multiple versions of Python installed under Vista. Is there any
    > easy way of switching between them so that invoking python and file
    > associations for Python extensions files work automatically ?


    These associations are stored in the registry. Just cut out the according
    sections[1] with the settings for each Python version and save them in a
    file each. You can then simply re-import the variant with the settings that
    you need in order to change. Note that these .reg files are just text
    files, so you can also change them using a text editor if there is need.

    Uli

    [1] e.g. HKEY_CLASSES_ROOT\Python.File
    --
    Domino Laser GmbH
    Geschäftsführer: Thorsten Föcking, Amtsgericht Hamburg HR B62 932
     
    Ulrich Eckhardt, Mar 8, 2011
    #2
    1. Advertising

  3. Edward Diener

    Tim Golden Guest

    On 08/03/2011 14:55, Edward Diener wrote:
    > I have multiple versions of Python installed under Vista. Is there any
    > easy way of switching between them so that invoking python and file
    > associations for Python extensions files work automatically ?


    Well, the answer depends a bit on how au fait you are with fiddling
    with env vars etc. but, if it helps, this script:

    https://winsys.googlecode.com/svn/trunk/random/associate.py

    will set the version of Python which runs it as the default.
    If you're running on Vista/W7, you'll probably need to run it
    with a param of "user" or inside an Elevated command prompt.

    TJG

    (Won't work w/ Python 3 without a bit of tweaking)
     
    Tim Golden, Mar 8, 2011
    #3
  4. Edward Diener

    Tim Golden Guest

    On 08/03/2011 15:58, Tim Golden wrote:
    > On 08/03/2011 14:55, Edward Diener wrote:
    >> I have multiple versions of Python installed under Vista. Is there any
    >> easy way of switching between them so that invoking python and file
    >> associations for Python extensions files work automatically ?

    >
    > Well, the answer depends a bit on how au fait you are with fiddling
    > with env vars etc....


    But essentially involves:

    * Adding c:\pythonxy and c:\pythonxy\script to PATH

    * assoc .py=python.file [probably already done]

    * python.file="C:\Pythonxy\python.exe" "%1" %*


    TJG
     
    Tim Golden, Mar 8, 2011
    #4
  5. On Tue, Mar 8, 2011 at 8:03 AM, Tim Golden <> wrote:
    > On 08/03/2011 15:58, Tim Golden wrote:
    >>
    >> On 08/03/2011 14:55, Edward Diener wrote:
    >>>
    >>> I have multiple versions of Python installed under Vista. Is there any
    >>> easy way of switching between them so that invoking python and file
    >>> associations for Python extensions files work automatically ?

    >>
    >> Well, the answer depends a bit on how au fait you are with fiddling
    >> with env vars etc....

    >
    > But essentially involves:
    >
    > * Adding c:\pythonxy and c:\pythonxy\script to PATH


    FWIW, ActivePython automatically does this. As it includes versioned
    binaries as well, one can type (just like on Unix) `python2.7.exe` or
    `python3.2.exe` in the Command Prompt.

    > * assoc .py=python.file [probably already done]
    >
    > * python.file="C:\Pythonxy\python.exe" "%1" %*


    I suppose I should soon implement Windows support in pythonselect,
    https://github.com/Activestate/pythonselect

    -srid
     
    Sridhar Ratnakumar, Mar 22, 2011
    #5
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Wade D. Peterson
    Replies:
    0
    Views:
    772
    Wade D. Peterson
    Sep 10, 2003
  2. Mike Cox
    Replies:
    3
    Views:
    365
    Josip Gracin
    Mar 5, 2005
  3. relisoft
    Replies:
    2
    Views:
    400
    Kenny McCormack
    Jul 20, 2005
  4. relisoft
    Replies:
    0
    Views:
    379
    relisoft
    Jul 19, 2005
  5. (RK) Sentinel

    bug fixing between gem releases

    (RK) Sentinel, Feb 13, 2009, in forum: Ruby
    Replies:
    0
    Views:
    101
    (RK) Sentinel
    Feb 13, 2009
Loading...

Share This Page