Re: Dual Python Installed Environments..
On Thu, 25 Oct 2007 14:45:51 -0700, sam wrote: > Hi.. > > I'm looking to install dual versions of python 2.3, 2.4 on the same box. > I'm trying to figure out if there's something I'm missing, some kind of > gotchas that I haven't seen. > > I'm also trying to figure out how to allow my script to determine which > version to use??? > > Thanks Here's one that tripped me up... I altered the symlink at /usr/bin/python to point to Python 2.2 which I installed in my home folder (see below for the reason.. in case you are wondering) this broke some packages in my distribution (Ubuntu). I could see the broken packages, and didn't need them anymore, but I was unable to remove them as the removal scripts were (presumably) python 2.4+ Much head scratching at the time. Neil. Reason - I had written some CGI scripts and tested them thoroughly on my localhost version of the site. However I uploaded the files, and some of them didn't work, my sites server (not under my full control) runs Python 2.2, so I downloaded 2.2, and made it default so that localhost used this version so I could retest and ammend etc.. -- http://mail.python.org/mailman/listinfo/python-list
Re: Dual Python Installed Environments..
Gaia dhuit, On Oct 25, 10:45 pm, "sam" <[EMAIL PROTECTED]> dropped 2 cents into the slot and wrote: > Hi.. Well, hello > > I'm looking to install dual versions of python 2.3, 2.4 on the same box. I'm > trying to figure out if there's something I'm missing, some kind of gotchas > that I haven't seen. > I know what you mean - sometimes things are just *too easy* to believe with Python. This is one of those: Just make sure you get the prefix right at installation time, and Python takes care of the rest., the two installations will be kept as separate as as the directories you choose. > I'm also trying to figure out how to allow my script to determine which > version to use??? Other things are more difficult: I cannot see how your script can choose an interpreter before the script is running.# OTOH one script could easily choose the correct interpreter for another script, e.g. #! /bin/bash if $MOON_IS_BLUE then ~/python24/bin/python script.py else /usr/bin/python script.py fi > Thanks Tá fáilte romhat -- jab Gaia leat -- http://mail.python.org/mailman/listinfo/python-list
Re: Dual Python Installed Environments..
sam wrote: > Hey Diez... > > So you're saying it's as simple as creating an env var, and setting it to > the python version... > > ok.. (and yeah, we're talking fedora) > No, env doesn't create an environment variable. It creates a modified environment. The goal here is to have the proper PATH variable set up. env is the preferred method of invoking the Python (and other) interpreter since it may not always be at /usr/bin/python. In distributions like Fedora, /usr/bin/python is usually a symlink to one of python2.5, python2.4, or python2.3 (or whatever have you), each one corresponding to the appropriate Python version. So you're just running the Python interpreter with the version number you desire directly. Without the version number, you will be using the system default. Thus the actual contents of the script running under Python 2.4 is: #!/usr/bin/env python2.4 print "Hello, World!" -- http://mail.python.org/mailman/listinfo/python-list
RE: Dual Python Installed Environments..
Hey Diez... So you're saying it's as simple as creating an env var, and setting it to the python version... ok.. (and yeah, we're talking fedora) Thanks -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] Behalf Of Diez B. Roggisch Sent: Thursday, October 25, 2007 2:48 PM To: python-list@python.org Subject: Re: Dual Python Installed Environments.. sam schrieb: > Hi.. > > I'm looking to install dual versions of python 2.3, 2.4 on the same box. I'm > trying to figure out if there's something I'm missing, some kind of gotchas > that I haven't seen. THey shouldn't affect each other. > I'm also trying to figure out how to allow my script to determine which > version to use??? under unix - simple as this: #!/usr/bin/env python Under Windows... well, I don't use that. Diez -- http://mail.python.org/mailman/listinfo/python-list -- http://mail.python.org/mailman/listinfo/python-list
Re: Dual Python Installed Environments..
sam schrieb: > Hi.. > > I'm looking to install dual versions of python 2.3, 2.4 on the same box. I'm > trying to figure out if there's something I'm missing, some kind of gotchas > that I haven't seen. THey shouldn't affect each other. > I'm also trying to figure out how to allow my script to determine which > version to use??? under unix - simple as this: #!/usr/bin/env python Under Windows... well, I don't use that. Diez -- http://mail.python.org/mailman/listinfo/python-list
Dual Python Installed Environments..
Hi.. I'm looking to install dual versions of python 2.3, 2.4 on the same box. I'm trying to figure out if there's something I'm missing, some kind of gotchas that I haven't seen. I'm also trying to figure out how to allow my script to determine which version to use??? Thanks -- http://mail.python.org/mailman/listinfo/python-list