When you have two versions of Python installed on the same computer, they generally live side-by-side if installed correctly. In the case of Windows, there are a few things to keep in mind:
-
A separate registry entry will be created for each of them (ex: HKEY_LOCAL_MACHINE \ SOFTWARE \ Python \ PythonCore \ 2.7
). I think that this goes even for smaller versions (% with% vs.% with%), but I'm not sure.
Within this entry there is a 2.6
key showing where Python is installed. If possible, check this (via 2.7
) and make sure that the version you are trying to run is accessible (if it is inside the admin home folder, you will probably only be able to access it if you run the system as an administrator).
-
Sometimes one of them will stop at the environment variable PythonPath
- to allow Python to execute by simply typing regedit
instead of the full path to the executable. It may be that the wrong version is in the path, and your system is calling it instead of the correct version.
In addition, if your system is a Django site / application deployed via Apache, it is important that Apache finds the correct version of python. From what you described, before when there was only one version worked well, but then when the other was installed it stopped working. This strongly suggests that the second version overwrote / gained precedence in PATH
and therefore Apache is trying to use it instead of the old one.
The most common form of Python / Apache integration is via python
. It is also possible to do this using obsolete PATH
and, in the case of Django, in some other ways too (eg mod_wsgi
). Find out which one your project is using, and find the information you need to specify one python among several. At mod_python
, for example, it's through the FastCGI
property. It must be set in the Apache configuration file. Maybe your error has something to do with mod_wsgi
instead (the error message was about something involving the "egg cache"). Other settings that may be helpful are: WSGIPythonExecutable
and WSGIPythonEggs
(in doubt, seven all of them, according to the documentation).
Update: I just remembered that support for WSGIPythonPath
on Windows is weak ... From what I read from the documentation linked above, most of these properties are not well supported in this environment. If so, I'm afraid your only way out will be to install a single version of Python ...
Finally, if the problem is not in Apache, but in the tool you're using to debug WSGIPythonHome
, you'll need to see in its settings how to specify the correct version to use. When that, I'm afraid I can not help ...