由于我安装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 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()

2、CMD中进入reg.py文件存放位置执行python reg.py

注:Python环境变量要配置好

Python 安装Twisted 提示python version 2.7 required,which was not found in the registry的更多相关文章

  1. 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 ...

  2. 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 ...

  3. 【转】安装第三方库出现 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 内容如下. 然 ...

  4. 安装第三方库出现 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 内容如下. 然 ...

  5. 安装pywin32出现--Python version 3.x required, which was not found in the registry

    这两天安装pywin32时出现了这个问题 双击.exe文件进入安装界面,然后点击下一步,它会自动定位你的python安装在什么地方,但是我的安装过程中未自动定位到python安装位置,并显示显示: 安 ...

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

    好久不更新随笔了,今天因为数据可视化作业,想抓取一些人人网好友关系数据,于是开始尝试python,用到numpy模块,安装的时候提示: 'Python Version 2.7 required, wh ...

  7. 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错误解决 解决: 建立一个文件 regis ...

  8. python 安装 twisted 库

    pip 安装twisted库需要先安装依赖包,不然报"error: command 'gcc' failed with exit status 1" # yum install g ...

  9. 计算机基础+python安装注意问题+python变量介绍

    1.什么是编程语言语言是一个事物与另外一个事物沟通的介质编程语言是程序员与计算机沟通的介质 2.什么是编程编程就是程序按照某种编程语言的语法规范将自己想要让计算机做的事情表达出来表达的结果就是程序,程 ...

随机推荐

  1. iis配置js支持读取json文件配置

    默认情况下,iis不支持解析.json文件,这就需要我们自己在iis下配置方法一:iis配置1.点击开始菜单选择控制面板: 2.控制面板内点击管理工具,选择Internet信息服务(IIS)管理器. ...

  2. Spring的Ioc和AOP扩展

    多种方式实现依赖注入: 这里唯一需要说明的是如果要使用P命名空间实现属性注入,需要添加命名空间的声明: 如我的xml里红色字体: <?xml version="1.0" en ...

  3. iOS开发:(线程篇-上)线程和进程

    iOS开发多线程篇—多线程简单介绍 一.进程和线程 1.什么是进程 进程是指在系统中正在运行的一个应用程序 每个进程之间是独立的,每个进程均运行在其专用且受保护的内存空间内 比如同时打开QQ.Xcod ...

  4. matlab画带标记的折线图

    1.不带标记的 如: x=[1,5,3,7,4] plot(x) 2. 带标记 plot(x,'-*') '-s'  表示方格 '-p' 表示五角星 '-d' 表示菱形 '-h' 表示六角形 '-+' ...

  5. 查看SQL语句在SQL Server上的执行时间

    set statistics profile onset statistics io onset statistics time ongo--begin <这里写上你的语句...>  se ...

  6. 用ssh整合时,用sessionfactory的getCurrentSession()获取不到session

    在用ssh整合时,一开始用的是getCurrentSession(),获取当前线程上的session,但是总是抛异常,不能获取. 后来用sessionfactory的openSession(),但是, ...

  7. java异常处理预习

    一.什么是异常处理 在程序运行过程中发生的.会打断程序正常执行的事件称为异常(Exception),也称为例外.比如:除零溢出.数组越界.内存溢出等,这些事件的发生将阻止程序的正常运行.传统的编程语言 ...

  8. 罗技 UE3100 蓝牙耳机使用

    罗技 UE3100 蓝牙耳机使用内置麦克风 蓝牙2.1蓝牙功能 和 手机 .平板 . 电脑 连接.开关 长按 5秒 开机 指示灯变成绿色并闪烁 此时耳机处于待蓝牙设备搜索状态当 智能手机 搜索 蓝牙设 ...

  9. Swift语言之类型方法

    Swift语言有很多特性,其中之一就是类型方法,相对于其他比较流行的编程语言(C#.Java),在Swift中类型方法最大的特征在于它的可继承性,我们举个例子说明: 俗话说,龙生龙凤生凤老鼠生儿会打洞 ...

  10. 面试题-Stack的最小值o(1)

    // Stack.cpp : 定义控制台应用程序的入口点. // #include "stdafx.h" #include <iostream> using names ...