[Tutor] Multiple versions of python and paths problems

Dominique mydomdom at gmail.com
Mon Sep 6 19:46:04 CEST 2010


Hello,

I usually use python 2.6 and several packages. Everything's fine.

At present, I'm trying to run a package which is only available with python 2.5.
So, i installed 2.5 and the various dependencies needed to run this package:
PIL, numpy... which were already installed in my 2.6 site-packages.

Unfortunately, when I try to run it under Idle 2.5, python goes in the 2.6
site-packages to get these dependencies (PIL,...) and throws me a traceback (due
to incompatibilities).

I understand it is a paths problem.

So, I added the path of python 2.5 and that of my application to the path and
Pythonpath in the windows environ variables.
But the same problems arise.

So, I tried to load the normal 2.5 Idle and unload ('remove') everything related
to 2.6 from sys.path, but it's strangely not working completely.

Finally, I managed to run the program :
- by launching D:\python25\python.exe -E -S in a console (which seems to prevent
python from loading the paths)
- then appending the application path to sys.path
but it's really not fun working with this bloody windows console where cut and
paste is impossible...

So, here is my question:
How can I force py2.5 to go and find the dependencies only in the 2.5
site-packages ?

Thanks in advance for your help.

Dominique



More information about the Tutor mailing list