Python version 2.7 required, which was not found in the registry
来源:互联网 发布:oracle数据备份与恢复 编辑:程序博客网 时间:2024/05/16 21:46
今天在安装PyYAML的时候,直接提示: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/distutils-sig@python.org/msg10512.html import sys from _winreg import * # tweak as necessaryversion = 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()
启动命令(cmd)切到register.py文件目录下执行:
python register.py显示“python 2.7 is already registered”
再安装PyYAML的时候,就能自动识别出来python2.7了
0 0
- Python安装第三方库报错:Python version 2.7 required, which was not found in the registry.
- python error python version 2.7 required,which was not found in the registry
- 安装python插件:python version 2.7 required,which was not found in the registry
- 安装第三方库出现 Python version 2.7 required, which was not found in the registry
- 安装第三方库出现 Python version 2.7 required, which was not found in the registry
- 安装第三方库出现 Python version 2.7 required, which was not found in the registry
- Python Version 2.7 required which was not found in the registry 问题解决
- Python version 2.7 required, which was not found in the registry
- Python version 2.7 required, which was not found in the registry
- python version 2.7 required,which was not found in the registry
- Python version 2.7 required, which was not found in the registry
- 安装第三方库出现 Python version 2.7 required, which was not found in the registry
- 安装第三方库出现 Python version 2.7 required, which was not found in the registry
- Python version 2.7 required, which was not found in the registry.
- 安装第三方库出现 Python version 2.7 required, which was not found in the registry
- Python version 2.7 required, which was not found in the registry
- 安装PIL遇到python version 2.7 required, which was not found in the registry解决办法
- Python version 2.7 required, which was not found in the registry
- Python学习笔记(8):input()与raw_input()
- const、static变量存放位置
- OpenCV4Android 选择图片并提取特征点
- 移动端app转码处理(根据不同设备的系统 安卓/ios)
- 黑马程序员_java_基础_数组和排序
- Python version 2.7 required, which was not found in the registry
- Android三种库的区别:pravite libraries、referenced libraries和dependency libraries
- 斐波那契(Fibonacci)数列
- FI 与MM SD的接口配置基本方法
- Less的点滴总结
- javascript与html代码相结合的方式
- 从Sqlite数据库里,通过mlate框架随机获取N条记录的过程
- 简易Java(03):Java类何时以及如何加载并初始化?
- 已知直线斜率是k, 且经过A(x1, y1), 求直线方程