安装第三方库出现 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\\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-08-06 10:19:57

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

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 安装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 问题解决

Python Version 2.7 required which was not found in the registry 问题解决 分类: 编程语言2013-07-25 20:45 6172人阅读 评论(4) 收藏 举报 今天在安装numpy时,出现了Python Version 2.7 required which was not found in the registry错误,解决方案如下. Python的一些第三方库只到注册表的HKEY_LOCAL_MACHINE\SOFTWARE\

Python version 3.3 required, which was not found in the registry

python registry函数语法 在windows下安装numpy的时候, 出现了"Python version 3.3 required, which was not found in the registry"的错误. 类似的有:Python version 2.7 required, which was not found in the registry 大致意思是说:注册表没有对应的信息. 只要执行一个python脚本,将HKEY_CURRENT_USER (HKCU)注

【转】Python version 2.7 required, which was not found in the registry

安装setuptools的时候,不能再注册表中识别出来python2.7 在网上找了方法,仅作笔记,供下次使用 方法: 新建一个register.py 文件,把一下代码贴进去,保存(G盘) 1 # 2 # script to register Python 2.0 or later for use with win32all 3 # and other extensions that require Python registry settings 4 # 5 # written by Joak

【亲测】Python:解决方案:Python Version 2.7 required, which was not found in the registry

好久不更新随笔了,今天因为数据可视化作业,想抓取一些人人网好友关系数据,于是开始尝试python,用到numpy模块,安装的时候提示: 'Python Version 2.7 required, which was not found in the registry' 发现很多人都遇到这个问题,网上说是官方不支持包,然后给了另外的链接让去下非官方版的,结果没找到囧... 于是发现了这个帖子,直接解决了问题,果断贴过来,帮助其他和我一样遭遇的人儿们. 原帖地址:http://www.xue5.co

Python version 3.6 required, which was not found in the registry错误解决

问题: 安装pywin32出现Python version 3.6 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\\Pyt

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

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

当安装第三方库的时候出现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