rammayur rammayur - 1 year ago 200
MySQL Question

mysql for python 2. 7 says Python v2.7 not found

I have downloaded mysql-connector-python-1.0.7-py2.7.msi from MySQL site
and try to install but it gives error that

Python v2.7 not found. We only support Microsoft Windows Installer(MSI) from python.org.

I am using Official Python v 2.7.3 on windows XP SP3 with MySQL esssential5.1.66

Need Help ???

Answer Source

The Solution I get for this problem is

I have found Adding Python to Registry, the script as follows applicable for python v 2.0 and above: Register a Python Interpreter

# script to register Python 2.0 or later for use with win32all 
# and other extensions that require Python registry settings
# written by Joakim Low for Secret Labs AB / PythonWare
# source:
# http://www.pythonware.com/products/works/articles/regpy20.htm

import sys
from _winreg import *

# tweak as necessary

version = sys.version[:3]
installpath = sys.prefix
regpath = "SOFTWARE\\Python\\Pythoncore\\%s\\" % (version)
installkey = "InstallPath"
pythonkey = "PythonPath"
pythonpath = "%s;%s\\Lib\\;%s\\DLLs\\" % (
    installpath, installpath, installpath)

def RegisterPy():
        reg = OpenKey(HKEY_LOCAL_MACHINE, regpath)
    except EnvironmentError:
            reg = CreateKey(HKEY_LOCAL_MACHINE, regpath)
            SetValue(reg, installkey, REG_SZ, installpath)
            SetValue(reg, pythonkey, REG_SZ, pythonpath)
            print "*** Unable to register!"
        print "--- Python", version, "is now registered!"

    if (QueryValue(reg, installkey) == installpath and
            QueryValue(reg, pythonkey) == pythonpath):
        print "=== Python", version, "is already registered!"

    print "*** Unable to register!"
    print "*** You probably have another Python installation!"

if __name__ == "__main__":

Save it with any name. Run it from python interpreter and Thats ALL!!

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download