MySQL-python-1.2.4b4.win32.-py2.7.exe安装失败,无法自动检测到python安装目录
MySQL-python-1.2.4b4.win32.-py2.7.exe为什么无法自动检测到python2.6.6的安装目录,自己手动输入也不行,求大神解答,谢谢
不是说支持2.4 -2.7么
MySQL-python-1.2.4b4.win32.-py2.7.exe为什么无法自动检测到python2.6.6的安装目录,自己手动输入也不行,求大神解答,谢谢
不是说支持2.4 -2.7么
2016-03-17
如果你电脑是64位的,新建一个register.py 文件,运行,它就可以检测到了
import sys
from _winreg import *
# tweak as necessaryversion = 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_CURRENT_USER, regpath) except EnvironmentError as e: try:
reg = CreateKey(HKEY_CURRENT_USER, 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()
举报