安装 pywin32-218.win32-py2.7.exe 报错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/[email protected]/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()  

然后执行此文件

然后即可正常安装了

时间: 2024-10-15 04:21:47

安装 pywin32-218.win32-py2.7.exe 报错python version 2.7 required,which was not found in the registry解决方案的相关文章

安装第三方库 报错Python version 2.7 required, which was not found in the registry

我的Windows 系统是64位 这个问题有人说是注册表没有 ,手动注册了一下就好了,但是我注册的时候运行报错. 那么我的做法是: 删掉本机所有安装过得python , 1. 先进入控制面板,删除程序 里删除安好的python, 2.然后再删除本地的文件(Python的整个文件夹) 3.如果安装过多版本的python,也要删掉 然后重新进官网下载64位的python, 然后在安装第三方库就可以了

96、python version 3.6 required,which was not fount in the registry(python3.6安装scrapy)

在安装scrapy时遇到问题 环境:win10(64位), Python3.6(64位) 安装scrapy: 1.安装wheel(安装后,便支持通过wheel文件安装软件) pip3 install wheel 2.安装lxml.pyopenssl lxml:解析XML的库,很强大,做爬虫BS4,selenium,XPATH都会用到 pip3 install lxml pip3 install pyopenssl 3.安装pywin32 下载网址: https://sourceforge.net

安装第三方库出现 Python version 2.7 required, which was not found in the registry

安装第三方库出现 Python version 2.7 required, which was not found in the registry 建立一个文件 register.py 内容如下. 然后执行该脚本. import sys from _winreg import * # tweak as necessary version = sys.version[:3] installpath = sys.prefix regpath = "SOFTWARE\\Python\\Pythonco

Python 安装Twisted 提示python version 2.7 required,which was not found in the registry

由于我安装Python64位的,下载后没注册,安装Twisted时老提示“python version 2.7 required,which was not found in the registry”错误 解决方法 1.任意位置存放reg.py文件 # # script to register Python 2.0 or later for use with win32all # and other extensions that require Python registry setting

当安装第三方库的时候出现Python version 2.7 required, which was not found in the registry

建立一个register.py文件,然后python2执行脚本 #!C:/Python27/python2.exe import sys from _winreg import * # tweak as necessary version = sys.version[:3] installpath = sys.prefix regpath = "SOFTWARE\\Python\\Pythoncore\\%s\\" % (version) installkey = "Inst

C-FREE5 出现 ld.exe报错 解决办法

因为入门是接触了C free,发现是蛮不错的一个IDE,但是用了很久一段时间之后,安装了MinGW发现不能用了.. 出问题之后换用了sublime text顶替了一段时间,今天闲着无聊,修理了下c-free,发现网上出同类问题的人还是蛮多的,现把问题及答案留在这里, 如果没能帮到你还请原谅 ^_^ 状况1:正常运行程序时偶尔会冒出ld.exe,如图: 此处强调的出现频率是 偶尔 ,素以具体报什么错已经记不清了,但是解决方法是这样的,ctrl+alt+delete,蓝后点任务管理器, 蓝后在进程里

java安装1.8和1.7,报错:Error: Registry key 'Software\JavaSoft\Java Runtime Environment'\CurrentVers

进入:C:\ProgramData\Oracle\Java\javapath; 删除:java.exe.javaw.exe.javaws.exe 删除:path的C:\ProgramData\Oracle\Java\javapath; 然后可能还会不行 进入:C:\Windows\System32 删除:java.exe.javaw.exe.javaws.exe 注意:\ProgramData可能是隐藏文件夹. java安装1.8和1.7,报错:Error: Registry key 'Soft

如何解决金蝶IKernel.exe报错 Windows Installer 错误 重新安装、无法卸载

如何解决金蝶IKernel.exe报错 Windows Installer 错误 金蝶这个小婊子,就是这么贱. 卸载了高版本的,再安装低版本就不能安装上,死活都不能安装. 请手动启动一下InstallService 服务,这个小婊子就让你制服了. 如果还不行,那么请去k3help.kingdee.com下载注册表清除工具,都清理一下,再安装,完美解决.   重新安装,提升已经安装了需要卸载,但就是卸载不掉,那么之间删除这个文件夹就好了 C:\Program Files (x86)\Install

Py打包exe报错

? Py打包exe报错 ? ? ? 下载地址 https://github.com/pyinstaller/pyinstaller ? ? ? 用管理员执行 ? pip install https://github.com/pyinstaller/pyinstaller/archive/develop.tar.gz