views:

47

answers:

1

After a fresh installation of my Windows dev machine, I installed Python 2.7. Quickly I learnt that this was a mistake as many of the packages I use only work on Python 2.6. So I installed 2.6 also and now I have both installations.

How can I make everything work with Python 2.6 instead of Python 2.7?

Every time I install a package it installs into Python 2.7. Every time I run a .py file it runs using the 2.7 interpreter.

Is there a way to completely uninstall Python 2.7?

+1  A: 

Most python installations come with an uninstaller that shows up in Add/Remove programs on Windows.

It is certainly possible to have several versions installed. On my windows machine, I have Python 2.5, 2.6, 2.7 and 3.1. The "default" python is the one which occurs first in your system path. Also (depending on which installer you used), you may have to change the handler for .py files in the registry. If you want to run a particular version, then start python.exe from the appropriate directory (C:\Python26\python.exe).

Managing packages should be pretty easy too. EXE packages are generally tied to the python version. PIL, for example has installers like PIL-1.1.7.win32-py2.5.exe for Python 2.5 and PIL-1.1.7.win32-py2.6.exe for Python 2.6. Other packages can be dropped into the right site-packages folder.

Seth
Surprisingly I did not find ANY python in my PATH. Also, in the add\remove programs I have Python 2.6.5 but not Python 2.7. How are both of these even possible?!
Jonathan
@JonathanNo Python in your path is possible because the Python installer (I think) mods your autoexec file. This can fail sometimes. I think this is covered somewhere in the Python FAQs/Docs.
new123456