Python cx_Oracle 安装异常处理

Python3.11 Oracle19 

1
pip install cx_Oracle

 解决 error: Microsoft Visual C++ 14.0 or greater is required.

error: Microsoft Visual C++ 14.0 or greater is required - 无虑的小猪 - 博客园

下载安装:visual studio 

 安装后重启执行OK

 测试:

复制代码
import cx_Oracle

print("cx_Oracle.version:", cx_Oracle.version)
conn=cx_Oracle.connect('用户名/密码@:端口/数据库')
c=conn.cursor()                                                
x=c.execute('select sysdate from dual')                         
data=x.fetchone()
print(data)
c.close()                                                      
conn.close() 
复制代码

 

posted @   bellin124  阅读(117)  评论(0编辑  收藏  举报
相关博文:
阅读排行:
· 无需6万激活码!GitHub神秘组织3小时极速复刻Manus,手把手教你使用OpenManus搭建本
· C#/.NET/.NET Core优秀项目和框架2025年2月简报
· Manus爆火,是硬核还是营销?
· 一文读懂知识蒸馏
· 终于写完轮子一部分:tcp代理 了,记录一下
历史上的今天:
2021-12-13 重置windows 所有端口
2021-12-13 Windows Server 2003 IIS Service Unavailable 问题解决
2021-12-13 MyEclipse配置tomcat环境
点击右上角即可分享
微信分享提示