I'm on Windows 7. I have Python 2.7 installed for years. I installed recently Python 3.4. I'm trying to use the new py launcher. When I open the cmd terminal and type py -2, I get this error message: Requested Python version (2) not installed. How can make py aware of my python 2.7 installation?
Note: python 2.7 is installed in a non-standard directory (not in C:\Python27), in case this is the problem.
解决方案
I found the solution. The registry had wrong entries. As I have a 32 bit version installed I went to HKEY_LOCAL_MACHINE|HKEY_CURRENT_USER\SOFTWARE\wow6432node\Python\PythonCore\2.7\InstallPath and the value was set to C:\Python27 while my installation is in D:\Python27. So I changed all the registry values to match the correct location and it now works fine.
It's been quite a while I installed Python 2.7, but I assume I had Python 2.7 installed first. Then I deleted it and installed pythonxy in this new location. I probably didn't uninstall the previous version correctly.