By Mayur Patil


2012-10-03 04:57:43 8 Comments

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

8 comments

@Christian Specht 2019-01-21 15:03:45

You need to make sure that you download the version with the correct "bitness" (32/64 bit), matching the "bitness" of your Python installation!

I ran into the same problem (with Python 3.7.2, though).

I had Python 3.7.2 32 bit already installed, but accidentally downloaded the 64 bit version of the MySQL Connector for Python 3.7.

When I tried to install the connector, I got the same error message:

error message

Solution: I just downloaded the 32 bit version instead, and everything worked (installing the connector and actually connecting to the database)

@dinesh.kumar 2015-09-30 19:07:15

This problem mainly comes with 64 bit windows. download MySQL for python 64 bit on this link http://www.codegood.com/archives/129 and download MySQL-python-1.2.3.win-amd64-py2.7.exe (1.0 MiB) This will install MySQL for python.

Windows 10 (64bit):
Indeed, I've had a similar issue and couldn't install the python 2.7 connector for MySQL.

Prior to this I've installed Python 2.7.15 with the Windows x86-64 MSI installer,
this was while I had Python 3 installed on my machine.

The Windows x86 MSI installer did the trick, I've installed it to override the previous version of Python 2.7.15, then installed the connector (this time it gave no error messages).

Then rechecked the status in the MySQL installer and voilĂ :
Python27 connector recognized

@zionpi 2016-03-22 08:35:12

This answer provides a good choice to select the working version of mysql-python 2.7 in X64.

@WesternGun 2017-10-16 13:47:44

In my case, I installed python 2.7.14 x64 only for my user. I have to look for this in my registry:

HKEY_CURRENT_USER\Software\Python

, export them, open the exported .reg file with a text editor, replace all occurrence of HKEY_CURRENT_USER with HKEY_LOCAL_MACHINE, and import it.

The result is: (remember to change the install dir to yours)

Windows Registry Editor Version 5.00

[HKEY_LOCAL_MACHINE\Software\Python]

[HKEY_LOCAL_MACHINE\Software\Python\PythonCore]

[HKEY_LOCAL_MACHINE\Software\Python\PythonCore\2.7]

[HKEY_LOCAL_MACHINE\Software\Python\PythonCore\2.7\Help]

[HKEY_LOCAL_MACHINE\Software\Python\PythonCore\2.7\Help\Main Python Documentation]
@="D:\\Desarrollo\\entornos\\python27_x64\\Doc\\python2714.chm"

[HKEY_LOCAL_MACHINE\Software\Python\PythonCore\2.7\InstallPath]
@="D:\\Desarrollo\\entornos\\python27_x64\\"

[HKEY_LOCAL_MACHINE\Software\Python\PythonCore\2.7\InstallPath\InstallGroup]
@="Python 2.7"

[HKEY_LOCAL_MACHINE\Software\Python\PythonCore\2.7\Modules]

[HKEY_LOCAL_MACHINE\Software\Python\PythonCore\2.7\PythonPath]
@="D:\\Desarrollo\\entornos\\python27_x64\\Lib;D:\\Desarrollo\\entornos\\python27_x64\\DLLs;D:\\Desarrollo\\entornos\\python27_x64\\Lib\\lib-tk"

And the installation afterwards is smooth as a breeze. Viola!

@RubenGeert 2016-08-09 08:12:22

I had this problem because I use Python only from within SPSS. I resolved this problem by manually adding two registry keys:

HKEY_LOCAL_MACHINE\SOFTWARE\Python\PythonCore\2.7\InstallPath

set to

C:\Program Files\IBM\SPSS\Statistics\24\Python

and

HKEY_LOCAL_MACHINE\SOFTWARE\Python\PythonCore\2.7\PythonPath

set to

C:\Program Files\IBM\SPSS\Statistics\24\Python\Lib

This easily fixed the issue on my previous as well as current laptops.

@WesternGun 2017-10-16 13:51:02

This inspired me and leads to my solution below. Thanks.

@Moony Chou 2012-12-16 07:41:06

I met the similar problem under Windows 7 when installing mysql-connector-python-1.0.7-py2.7.msi and mysql-connector-python-1.0.7-py3.2.msi.

After changing from "Install only for yourself" to "Install for all users" when installing Python for windows, the "python 3.2 not found" problem disappear and mysql-connector-python-1.0.7-py3.2.msi was successfully installed.

I guess the problem is that mysql connector installer only looks for HKEY_LOCAL_MACHINE entries, and the things it looks for might be under HKEY_CURRENT_USER etc. So the solution that change the reg table directly also works.

@primo 2014-10-30 08:46:07

Still relevant for connector v2.0.1. Reinstalling Python "For all users" fixed the problem.

@user3375672 2015-08-21 23:05:02

This works for me as well ("install for all users") on windows7 using python 3.4.

@Sar009 2013-09-27 12:45:04

I solved this problem by using 32bit python

@Killrawr 2013-01-24 22:28:30

If you're still experiencing this with x64 or other python modules, I'd recommend this website Python Extensions for x64/x32

@Mayur Patil 2012-10-06 06:33:23

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():
    try:
        reg = OpenKey(HKEY_LOCAL_MACHINE, regpath)
    except EnvironmentError:
        try:
            reg = CreateKey(HKEY_LOCAL_MACHINE, regpath)
            SetValue(reg, installkey, REG_SZ, installpath)
            SetValue(reg, pythonkey, REG_SZ, pythonpath)
            CloseKey(reg)
        except:
            print "*** Unable to register!"
            return
        print "--- Python", version, "is now registered!"
        return

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

    CloseKey(reg)
    print "*** Unable to register!"
    print "*** You probably have another Python installation!"

if __name__ == "__main__":
    RegisterPy()

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

Related Questions

Sponsored Content

22 Answered Questions

[SOLVED] What are metaclasses in Python?

42 Answered Questions

[SOLVED] How to get the current time in Python

  • 2009-01-06 04:54:23
  • user46646
  • 3344271 View
  • 2947 Score
  • 42 Answer
  • Tags:   python datetime time

30 Answered Questions

[SOLVED] Finding the index of an item in a list

  • 2008-10-07 01:39:38
  • Eugene M
  • 3957406 View
  • 3243 Score
  • 30 Answer
  • Tags:   python list indexing

26 Answered Questions

[SOLVED] Does Python have a ternary conditional operator?

61 Answered Questions

[SOLVED] Calling an external command from Python

10 Answered Questions

[SOLVED] Does Python have a string 'contains' substring method?

23 Answered Questions

[SOLVED] How do I connect to a MySQL Database in Python?

  • 2008-12-16 21:49:09
  • Marc Lincoln
  • 1257250 View
  • 1169 Score
  • 23 Answer
  • Tags:   python mysql

39 Answered Questions

[SOLVED] Should I use the datetime or timestamp data type in MySQL?

Sponsored Content