本篇文章主要介绍了" python version 27 required,which was not found in the registry",主要涉及到方面的内容,对于MySql感兴趣的同学可以参考一下:
pycharm 中安装mysql_python时,提示错误,需要安装文件MySQL-python-1.2.3.win-amd64-py2.7时,但安装此文件时又...
pycharm 中安装mysql_python时,提示错误,需要安装文件MySQL-python-1.2.3.win-amd64-py2.7时,但安装此文件时又出现提示:python version 2.7 required,which was not found in the registry。
解决方案:方法:新建一个register.py 文件,把一下代码贴进去,保存.
## script to register Python 2.0 or later for use with win32all# and other extensions that require Python registry settings## written by Joakim Loew for Secret Labs AB / PythonWare## source:# http://www.pythonware.com/products/works/articles/regpy20.htm## modified by Valentine Gogichashvili as described in http://www.mail-archive.com/distutils-sig@python.org/msg10512.htmlimport 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
)
defRegisterPy():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!"returnprint"--- Python", version, "is now registered!"returnif (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()
代码来自:http://effbot.org/zone/python-register.htm
然后按f5执行,结果显示如下即成功。 Python 2.7 is now registered!
').addClass('pre-numbering').hide();
$(this).addClass('has-numbering').parent().append($numbering);
for (i = 1; i <= lines; i++) {
$numbering.append($('
').text(i));
};
$numbering.fadeIn(1700);
});
});
以上就介绍了 python version 27 required,which was not found in the registry,包括了方面的内容,希望对MySql有兴趣的朋友有所帮助。
本文网址链接:http://www.codes51.com/article/detail_1707467.html