mysql for python2.7 말한다 Python v2.7 발견되지 않았
-
12-12-2019 - |
문제
나는 다운로드 mysql-커넥터-python-1.0.7-py2.7.msi 에서 MySQL 사이트 고 설치하려고 하지만 그것이 제공하는 오류
Python v2.7 찾을 수 없습니다.우리는 단지 지원 마이크로소프트 윈도우 설치 프로그램(MSI)서 python.org.
내가 사용하는 공식 Python v2.7.3 에 윈도우 XP SP3 에 MySQL esssential5.1.66
도움이 필요하십니까???
해결책 2
이 문제에 대해 얻는 솔루션은
입니다.Python에 Python V 2.0 이상에 적용 할 수있는 다음과 같이 레지스트리에 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()
.
모든 이름으로 저장하십시오. 파이썬 인터프리터에서 실행하고 모든 것!
다른 팁
내가 만나는 유사한 문제에 설치하는 경우 윈도우 7 mysql-connector-python-1.0.7-py2.7.msi
고 mysql-connector-python-1.0.7-py3.2.msi
.
후에서 변경 "Install only for yourself"
하기 "Install for all users"
설치하는 경우 Python windows "python 3.2 not found"
문제는 사라지고 mysql-connector-python-1.0.7-py3.2.msi
성공적으로 설치됩니다.
나는 문제는 mysql 커넥터 설치 관리자만 HKEY_LOCAL_MACHINE
항목하고 있는 것을 찾을 수 있습래 HKEY_CURRENT_USER
etc.그래서 솔루션을 변경하는 reg 테이블을 직접 또한을 작동합니다.
이 문제는 주로 오는 64 비트 윈도우.다운로드 MySQL 데이터베이 64 비트 이 링크 http://www.codegood.com/archives/129 다운로드 MySQL-python-1.2.3.win-amd64-py2.7.exe (1.0MiB) 이 설치됩니다 MySQL for python.
Windows10(64 비트):
실제로,나는 유사한 문제 수 없었을 설치하는 파이썬 2.7 커넥터 MySQL.
이에 앞서 나는 설치 Python 2.7.15
과 Windows x86-64 MSI installer
,
이는 동안 했 Python 3
에 설치되어 있는 기계입니다.
이 Windows x86 MSI installer
은 속임수를 썼는지,나는 그것을 설치하는 override 이전 버전의 Python2.7.15,다음 설치 연결관(이 시간은 그것을 했다거나 오류 메시지가 표시되지는 않).
x64
또는 다른 Python 모듈을 사용하면 여전히이 웹 사이트 x64 / x32의 파이썬 확장
SPSS에서만 파이썬을 사용하기 때문에이 문제가있었습니다.>.두 개의 레지스트리 키를 수동으로 추가 하여이 문제를 해결했습니다.
HKEY_LOCAL_MACHINE\SOFTWARE\Python\PythonCore\2.7\InstallPath
C:\Program Files\IBM\SPSS\Statistics\24\Python
HKEY_LOCAL_MACHINE\SOFTWARE\Python\PythonCore\2.7\PythonPath
내 경우에 나는 Python 2.7.14 x64를 내 사용자에게만 설치했습니다.내 레지스트리에서 이것을 찾아야합니다.
HKEY_CURRENT_USER\Software\Python
.
을 내보내고 텍스트 편집기로 내 보낸 .reg
파일을 열고 generacodicicetagcode의 모든 발생을 HKEY_CURRENT_USER
로 대체하고 가져 오십시오.
결과는 다음과 같습니다. (install dir을 ouse) 잊지 마십시오.
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"
.
및 설치 후에 설치가 부드럽습니다.비올라!
32 비트 파이썬
를 사용 하여이 문제를 해결했습니다.