[Tutor] Multiple versions of python and paths problems

Alan Gauld alan.gauld at btinternet.com
Tue Sep 7 00:38:19 CEST 2010

"Dominique" <mydomdom at gmail.com> wrote

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

How do you start IDLE? Is it via a desktop or start menu shortcut?
If so what is the startin folder specified as?

What happens when you run it from the command ine with no extra
parameters - what error do you get?

Do you have both versions of Python in your environment variables?
In which order?
Hint: Start a DOS session and type

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

Set the Quick Edit option for the terminal it will save you a lot of 
Cut n paste are then possible. In fact you should probably read the
Windows help on CMD too because there are a lot of settings/registry
tweaks that improves the use of the CMD prompt dramatically.
Also look at the WindowsPowerShell - it has a lot of this "out of the 

But that aside you shouldn't have to do all this!

> How can I force py2.5 to go and find the dependencies only in the 
> 2.5
> site-packages ?

There are probably several ways round it, including creating a local 
startup file.

But if the paths are right it should work, and you may need to create 
a startup
DOS file to set them before executing python...


Alan Gauld
Author of the Learn to Program web site

More information about the Tutor mailing list