Reputation: 972
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 ???
Upvotes: 12
Views: 19452
Reputation: 36431
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:
Solution: I just downloaded the 32 bit version instead, and everything worked (installing the connector and actually connecting to the database)
Upvotes: 2
Reputation: 168
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à:
Upvotes: 7
Reputation: 12767
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!
Upvotes: 1
Reputation: 2952
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.
Upvotes: 2
Reputation: 507
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.
Upvotes: 10
Reputation: 4042
If you're still experiencing this with x64
or other python modules, I'd recommend this website Python Extensions for x64/x32
Upvotes: 4
Reputation: 972
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!!
Upvotes: 8