Python version 3.6 required, which was not found in the registry错误解决
2023-09-11 14:21:24 时间
问题:
安装pywin32出现Python version 3.6 required, which was not found in the registry错误解决
解决:
建立一个文件 register.py 内容如下. 然后执行该脚本.
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,要注意哪些隐秘的错误认知?
- 当Python遇到Andriod手机 万物皆可盘
- 【Python实战】python中含有中文字符无法运行
- 【Python五篇慢慢弹(3)】函数修行知python
- 用Python输出一个杨辉三角的例子
- paip.python错误解决24
- paip.python错误解决20
- paip.python错误解决19
- paip.python错误解决12
- paip.python错误解决10
- paip.python错误解决 "0x64024e96" 指令引用的 "0x00000135" 内存。该内存不能为 "read"。
- paip. 解决php 以及 python 连接access无效的参数量。参数不足,期待是 1”的错误
- paip. 解决php 以及 python 连接access无效的参数量。参数不足,期待是 1”的错误
- Python:利用python编程将上海十六区,2020年5月份房价实时地图(数据来源房天下)进行柱状图、热图可视化
- Python编程:利用python编程实现对基于时间序列的数据(dataframe格式)按照指定时间范围进行单方向关联,不存在的日期补充为默认的NaN
- Python语言学习:解决python版本升级问题集合(python2系列→Python3系列)导致错误的总结集合
- Python:利用python编程实现三维图像绘制展示(六面体旋转、三维球柱状体、下雪场景等)
- python --> Python初阶 --> 基础语法 --> 条件和分支
- 已解决2.Set PROTOCOL_BUFFERS_PYTHON_IMPLEMENTATION=python (but this will use pure-Python parsing and wi
- 〖Python WEB 自动化测试实战篇③〗- python-selenium环境配置搭建
- Python编程:查看python环境支持的whl
- Python编程:查看python语法中的关键字keyword
- python recv()是什么
- 用Python做数据分析之数据筛选及分类汇总