转自:https://blog.csdn.net/zklth/article/details/8117207

新建一个register.py文件,执行该文件,完成python的注册。

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()

Python version 2.7 required, which was not found in the registry解决方法的更多相关文章

  1. Python version 3.4 required, which was not found in the registry.解决

    问题描述: 在Win7环境下已安装Python3.4,准备安装numpy和nltk,运行安装程序报如题错误,具体解决方案如下: 1.将LOCAL_MACHINE\software\python\Pyh ...

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

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

  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. 【亲测】Python:解决方案:Python Version 2.7 required, which was not found in the registry

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

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

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

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

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

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

随机推荐

  1. Linux学习笔记15—RPM包的安装OR源码包的安装

    RPM安装命令1. 安装一个rpm包rpm –ivh 包名“-i” : 安装的意思“-v” : 可视化“-h” : 显示安装进度另外在安装一个rpm包时常用的附带参数有:--force : 强制安装, ...

  2. ASP.NET Web API中通过URI显示实体中的部分字段

    有时候我们可能不想显示某个实体中的所有字段.比如客户端发出如下请求: locaohost:43321/api/groups/1/items?fields=idlocaohost:43321/api/g ...

  3. Scala:Method 小技巧,忽略result type之后的等号

    var x = 0 def IncreaseOne(): Int = { x += 1 x } def IncreaseOne() = { x += 1 x } def IncreaseOne = { ...

  4. java 查看线程的信息

    的代码上加上 断点 运行 进入Terminal jps 查看进程号 jstack 进程号  查看线程的信息 jstack pid 此时进去DEBUG 端F9 跑完程序 再回到Terminal 中 就能 ...

  5. SimpleCaptcha生成图片验证码内容为乱码

    转自:https://blog.csdn.net/wlwlwlwl015/article/details/51482065 前言 报表中发现有中文乱码和中文字体不整齐(重叠)的情况,首先考虑的就是操作 ...

  6. donet core 2.1 DateTime ToString() 方法 在不同平台返回的时间格式不一样?

    跟操作系统的 设置的时间格式和系统区域设置有关.为了保持一致性.参数自己写好格式.

  7. .NET 同步与异步 之 警惕闭包(十)

    本随笔续接:.NET 同步与异步 之 原子操作和自旋锁(Interlocked.SpinLock)(九) 至此.同步与异步 相关的常规操作(比较常见的操作).差不多已经介绍完毕. 本随笔就着重说一下闭 ...

  8. s:iterator 标签使用错误记录

    <s:iterator value="newMarriageMoveList" id='tpNewMarriage' status="number"> ...

  9. Django的AbstractUser的几大步骤

    - 导入 AbstractUser from django.contrib.auth.models import AbstractUser - 往其中添加列,即可在Django的基础上添加我们所需要的 ...

  10. CentOS 7 安装SVN服务端

    CentOS7下安装SVN服务 1. yum命令即可方便的完成安装# sudo yum install subversion 测试安装是否成功:# svnserve --version 更改svn的默 ...