Python version 2.7 required, which was not found in the registry
Python in The not found version was required
2023-09-14 08:58:25 时间
http://www.cnblogs.com/min0208/archive/2012/05/24/2515584.html
安装setuptools的时候,不能再注册表中识别出来python2.7
在网上找了方法,仅作笔记,供下次使用
方法:
新建一个register.py 文件,把一下代码贴进去,保存(G盘)
输入以下命令(register.py 存放在 G盘底下)
显示“python 2.7 is already registered”
再安装setuptools的时候,就能自动识别出来python2.7了。
win7是 64的原因,在安装python(32位)时,如果选择只为当前用户,以上问题是不会出现的,如果选择所有用户,那就用上面的方法解决吧。
# # 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()
![](https://pic002.cnblogs.com/images/2012/370308/2012052400040771.png)
相关文章
- 【Python成长之路】python 基础篇 -- global/nonlocal关键字使用
- Reporting Service 服务启动时报错The service did not respond to the start or control request in a timely fashion
- Python version 2.7 required, which was not found in the registry
- 关于Python ,requests的小技巧
- [Python] Finding the most common elements in an iterable
- sharepoint2010:The number of items in this list exceeds the list view threshold, which is 20000 items.
- 【Python五篇慢慢弹(5)】类的继承案例解析,python相关知识延伸
- 【Python五篇慢慢弹(3)】函数修行知python
- Python 字符串_python 字符串截取_python 字符串替换_python 字符串连接
- Python 日期和时间_python 当前日期时间_python日期格式化
- Atitit python3.0 3.3 3.5 3.6 新特性 Python2.7新特性1Python 3_x 新特性1python3.4新特性1python3.5新特性1值得关注的新特性1Python3.6新特性2 Python2.7新特性Python 2.7的新特性 - 牛皮糖NewPtone - 博客园.html Python 3_x 新特性及10大变化_python_脚本之家.htm
- Python画圣诞树源代码
- Python语言学习:在python中,如何获取变量的本身字符串名字而非其值/内容及其应用(在代码中如何查找同值的所有变量名)
- 成功解决WARNING: pip is configured with locations that require TLS/SSL, however the ssl module in Python
- Python之tkinter:动态演示调用python库的tkinter带你进入GUI世界(Entry/Entry的Command)
- Python语言学习:解决python版本升级问题集合(python2系列→Python3系列)导致错误的总结集合
- 成功解决WARNING: pip is configured with locations that require TLS/SSL, however the ssl module in Python
- 100天精通Python(基础篇)——第20天:pip命令大全
- 已解决WARNING: pip is configured with locations that require TLS/SSL, however the ssl module in Python
- 〖Python接口自动化测试实战篇⑧〗- 小案例 - 使用python实现接口请求 [查询天行数据]
- 【华为OD机试 2023】最长回文字符串(C++ Java JavaScript Python)
- Caused by: org.xml.sax.SAXParseException; systemId: file:/home/hadoop/hive-0.12.0/conf/hive-site.xml; lineNumber: 5; columnNumber: 2; The markup in the document following the root element must be well
- 源码安装python
- *args and **kwargs in Python 变长参数
- The absolute uri: http://java.sun.com/jsp/jstl/core cannot be resolved in either web.xml or the jar
- 通过谷歌搜索恶意软件家族详细信息【python脚本】
- 【python】Python实现网络爬虫demo实例
- 解决办法:The name 'Response' does not exist in the current context