关于”python version 2.7 required,which was not found in the registry“的问题
来源:互联网 发布:2016淘宝官方活动 编辑:程序博客网 时间:2024/05/21 01:31
安装MySQL-python-1.2.5.win32-py2.7或者其它库时报如下问题:
python version 2.7 required,which was not found in the registry
解决办法,运行如下脚本即可:
#本脚本用于python注册脚本,便于安装python库不识别python版本之用import sysfrom _winreg import *#_winreg python操作注册表的模块version = sys.version[:3]installpath = sys.prefixregpath = "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()
运行结果如下:
0 0
- 关于”python version 2.7 required,which was not found in the registry“的问题
- 安装Python-Matplotlib时出现的问题--Python version 2.7 required, which was not found in the registry
- 安装Python-Matplotlib时出现的问题--Python version 2.7 required, which was not found in the registry
- 解决Win10安装PyWin32问题Python Version 3.4 required which was not found in the registry
- Python安装第三方库报错:Python version 2.7 required, which was not found in the registry.
- python error python version 2.7 required,which was not found in the registry
- 安装python插件:python version 2.7 required,which was not found in the registry
- 安装第三方库出现 Python version 2.7 required, which was not found in the registry
- 安装第三方库出现 Python version 2.7 required, which was not found in the registry
- 安装第三方库出现 Python version 2.7 required, which was not found in the registry
- Python Version 2.7 required which was not found in the registry 问题解决
- Python version 2.7 required, which was not found in the registry
- Python version 2.7 required, which was not found in the registry
- python version 2.7 required,which was not found in the registry
- Python version 2.7 required, which was not found in the registry
- 安装第三方库出现 Python version 2.7 required, which was not found in the registry
- 安装第三方库出现 Python version 2.7 required, which was not found in the registry
- Python version 2.7 required, which was not found in the registry.
- Android开发优化之——使用软引用和弱引用
- Android5.0适配——水波纹点击效果
- WeakReference
- Quartz与Spring的整合-Quartz中的job如何自动注入spring容器托管的对象
- Java动态读取map里面的key值
- 关于”python version 2.7 required,which was not found in the registry“的问题
- 存储过程异常处理
- 第四章 进程的控制与终止
- 浩辰电气2013软件下载以及keygen 吉米多维奇习题集全六册
- 如何防止表单重复提交
- 数论基本定理
- 打开eclipse,maven项目报错(maven设置正确)问题解决
- Could not get lock /var/lib/apt/lists/lock - open
- Java类加载机制