python version 3.3 required,which was not found in the registry
来源:互联网 发布:iphone的照片导入mac 编辑:程序博客网 时间:2024/06/05 14:32
安装 cx_Oracle-5.1.3-11g.win-amd64-py3.3.exe 的时候,不能再注册表中识别出来python3.3
再安装 cx_Oracle-5.1.3-11g.win-amd64-py3.3.exe 的时候,就能自动识别出来python3.3了。
win7是 64的原因,在安装python(32位)时,如果选择只为当前用户,以上问题是不会出现的,如果选择所有用户,那就用上面的方法解决吧。
方法:新建一个register.py 文件,把一下代码贴进去,保存后执行。
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()
再安装 cx_Oracle-5.1.3-11g.win-amd64-py3.3.exe 的时候,就能自动识别出来python3.3了。
win7是 64的原因,在安装python(32位)时,如果选择只为当前用户,以上问题是不会出现的,如果选择所有用户,那就用上面的方法解决吧。
0 0
- python version 3.3 required,which was not found in the registry
- 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解决办法
- MongoDB的分片集群配置
- Android 好的文章整理
- 倒计时
- 没有acm我会是什么?
- iOS 开发相关网址
- python version 3.3 required,which was not found in the registry
- 【BZOJ3998】【TJOI2015】弦论 后缀自动机
- 操作系统(七)——存储管理
- 第九周 项目一:复数类中的运算符重载(续)
- JAVA--多线程管理
- 提高Web服务端并发效率的异步编程技术
- 关于 java.util.concurrent.RejectedExecutionException
- UIImagePickerController
- select、poll、epoll之间的区别总结[整理]