Pregunta

He descargado MySQL-Connector-Python-1.0.7-Py2.7.msi desde el sitio mySQL e intento instalar, pero le da un error a eso

Python v2.7 no encontrado.Solo admitimos Microsoft Windows Installer (MSI) desde python.org.

Estoy usando Official Python v 2.7.3 en Windows XP SP3 con MySQL esssential5.1.66

Necesitas ayuda ???

¿Fue útil?

Solución 2

La solución que recibo para este problema es

He encontrado agregando Python al Registro, el script de la siguiente manera aplicable para Python V 2.0 y superior: Registrar un intérprete de Python

#
# 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()

GURARLO CON CUALQUIER NOMBRE. ¡Ejecute desde el intérprete de Python y eso es todo!

Otros consejos

Me encontré con un problema similar en Windows 7 al instalar mysql-connector-python-1.0.7-py2.7.msi y mysql-connector-python-1.0.7-py3.2.msi.

Después de cambiar de "Install only for yourself" a "Install for all users" Al instalar Python para Windows, el "python 3.2 not found" el problema desaparece y mysql-connector-python-1.0.7-py3.2.msi se instaló exitosamente.

Supongo que el problema es que el instalador del conector MySQL sólo busca HKEY_LOCAL_MACHINE entradas, y las cosas que busca pueden estar bajo HKEY_CURRENT_USER etc.Entonces, la solución que cambia la tabla de registro directamente también funciona.

Este problema viene principalmente con ventanas de 64 bits.descargue MySQL para Python de 64 bits en este enlace http://www.codegood.com/archives/129 y descargar MySQL-python-1.2.3.win-amd64-py2.7.exe (1,0 MiB) Esto instalará MySQL para Python.

Windows 10 (64 bits):
De hecho, tuve un problema similar y no pude instalar el conector Python 2.7 para MySQL.

Antes de esto he instalado Python 2.7.15 con el Windows x86-64 MSI installer,
esto fue mientras tenia Python 3 instalado en mi máquina.

El Windows x86 MSI installer Hice el truco, lo instalé en anular la versión anterior de Python 2.7.15, luego instaló el conector (esta vez no dio mensajes de error).

Luego volvió a verificar el estado en el instalador de MySQL y listo:
Python27 connector recognized

Si aún está experimentando esto con x64 u otros módulos de Python, recomendaría este sitio web Extensiones de Python para X64 / X32

Debe asegurarse de descargar la versión con el "pitness" correcto (bit 32/64), coincidir con la "pitidez" de su instalación de Python!

Me encontré con el mismo problema (con Python 3.7.2, aunque).

Tuve Python 3.7.2 32 bit ya instalado, pero descargué accidentalmente la versión 64 bit del conector MySQL para Python 3.7.

Cuando intenté instalar el conector, obtuve el mismo mensaje de error:

 Mensaje de error

Solución: Acabo de descargar la versión de 32 bits, y todo funcionó (instalando el conector y en realidad se conecta a la base de datos)

En mi caso, instalé Python 2.7.14 x64 solo para mi usuario.Tengo que buscar esto en mi registro:

HKEY_CURRENT_USER\Software\Python

El resultado es: (Recuerde cambiar el directorio de instalación a la suya)

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"

y la instalación después es suave como una brisa.¡Viola!

Resolví este problema usando 32bit Python

Licenciado bajo: CC-BY-SA con atribución
No afiliado a StackOverflow
scroll top