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

原创 2013年12月05日 23:41:29
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()


如果在windows环境下安装python的第三方库时出现如上的错误,可以用以上的脚本编译解决

解决安装MySQL-python出现的:Python version 2.7 required, which was not found in the registry

安装MySQL-python-1.2.3.win-amd64-py2.7.exe,时提示:Python version 2.7 required, which was not found in the...

python version 2.7 required,which was not found in the registry

安装MySQL-python-1.2.5.win32-py2.7 (64位系统也可以安装)时,出现问题:python version 2.7 required,which was not found ...

Python Version 2.7 required which was not found in the registry

在使用“MySQLdb”操作MySQL数据库时,提示错误:ERR import MySQLdb ImportError: No module named MySQLdb,然后去下载安装包“MySQL-...

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

转自:http://www.cnblogs.com/min0208/archive/2012/05/24/2515584.html 安装setuptools的时候,不能再注册表中识别出来pyth...

安装cx_Oracle报错python version 3.4 required, which was not found in the registry

在安装https://pypi.python.org/pypi/cx_Oracle/5.2.1#downloads 下载了cx_Oracle,安装时提示python version 3.4 requi...

64位系统装32位的Python,Python version 3.5 required, which was not found,DLL load failed

64位系统装了32位的Python,安装exe格式对应python版本相关的包,报错:Python version 3.5 required, which was not found in the...

python2.7.x使用pip安装第三方库lxml

首先先从官网下载对应的lxml。http://www.lfd.uci.edu/~gohlke/pythonlibs/#lxml 我下载的是lxml‑3.8.0‑cp27‑cp27m‑win_am...

第三方库,Directory not found 解决办法

发现很多人遇到一个问题,在一个项目中倒入第三方库,在本地编译是没有任何问题的,结果上传到svn,别人check下来,或者将项目挪移到另一个路径下面,编译的时候就会报形如下方的错误: 针对这种问题,...
  • SiamPig
  • SiamPig
  • 2014年03月24日 10:16
  • 774

ld: library not found for -l+第三方库名称报错分析

1. 还有就是打开工程的那个文件点错了;(是点击*.scworkspace  而不是 *.xcodeproj) 很多时候使用Pods之后会让程序写起来更方便,但是有时候设置不好,出现问题...

has unsupported major or minor version numbers, which are greater than those found in the Java Runti

Class ceilometer.services.LocalIDFactory has unsupported major or minor version numbers, which are g...
内容举报
返回顶部
收藏助手
不良信息举报
您举报文章:安装第三方库出现 Python version 2.7 required, which was not found in the registry
举报原因:
原因补充:

(最多只允许输入30个字)