# # 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.html 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_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()
相关推荐
成功解决安装pywin32时出现python version 3.6 required, which was not found in the registry 目录 解决问题 解决方法 第一步,打开注册编辑器:regedit 第二步,如图所示,定位到python 第三步,把注册表中文件夹...
32/64位windows,python2.7用的MySQL-python 解决安装MySQL-python出现的:Python version 2.7 required, which was not found in the registry
安装pycrypto-2.6.win32py2.7.exe时会报“Python version 2.7 required, which was not found in the registry ”时请按照:http://www.cnblogs.com/min0208/archive/2012/05/24/2515584.html上操作即可。...
解决Python version 2.7 required, which was not found in the registry 内有安装scrapy win64位安装教程及所有安装插件,成功安装 1.python-2.7.8.amd64.msi 2.pywin32-219.win-amd64-py2.7.exe 3.zope.interface-...
2、安装时会出现以下错误:Python version 2.7 required, which was not found in the registry。 解决办法: (1)新建一个register.py文件,把以下代码粘贴进去,保存到D盘。 # script to register Python 2.0 or ...
解决安装PyWin32问题:Python version x.x required, which was not found in the registry.
windows安装python mysqldb时报错python version 2.7 required,which was not found in the registry 网上很多方案,比如方案一: Python3.x时, from _winreg import * 改为 from winreg import * 去掉下划线 ...
从网站下载,完成后双击安装,但提示Python version -32 required, which was not found in the registry. 从网上搜索到以下解决方案: 新建文件D:\register.py,通过脚本建立注册信息 #===============register....
- **Python未在注册表中注册的问题**:当执行pip安装命令时,如果遇到错误提示“Python version 2.7 required, which was not found in the registry”,可以采取以下解决方法: 1. 创建一个名为`register.py`的...