解决python3.6用cx_Oracle库连接Oracle的问题
作者:ABCGirlly 时间:2023-06-12 02:38:46
1.Python代码
import cx_Oracle
tns=cx_Oracle.makedsn('127.0.0.1','1521','mytest')
db=cx_Oracle.connect('system','123456',tns)
print('成功连接上oracle数据库')
db.close();
2.报错信息及解决 错误1:cx_Oracle.DatabaseError: DPI-1047: Cannot locate a 64-bit Oracle Client library
解决办法:下载对应版本的 instant client 工具包,我这里下载的是win64 12.2版本的
https://download.oracle.com/otn/nt/instantclient/122010/instantclient-basic-nt-12.2.0.1.0.zip
然后,解压zip,把该文件下的所有dll文件拷贝到Python安装目录即可
错误2:cx_Oracle.DatabaseError: DPI-1072:…
这个错误是因为 instant client 的版本不对应,所以下载其他版本的来试试即可解决
来源:https://blog.csdn.net/Brave_heart4pzj/article/details/105878304
标签:python3.6,cx,Oracle库,Oracle
![](/images/zang.png)
![](/images/jiucuo.png)
猜你喜欢
Python 字符串与数字输出方法
2021-09-01 09:01:59
Javascript优化技巧(文件瘦身篇)
2024-04-22 13:04:16
python超时重新请求解决方案
2022-04-22 00:16:12
利用索引提高SQL Server数据处理的效率
2009-01-08 15:32:00
PyQt5实现拖放功能
2023-08-06 11:52:56
![](https://img.aspxhome.com/file/2023/2/103472_0s.png)
Python文件读写w+和r+区别解析
2022-01-12 04:23:04
python中自带的三个装饰器的实现
2021-10-28 02:31:52
BOM中location对象的属性和方法
2024-04-16 09:55:07
![](https://img.aspxhome.com/file/2023/7/136497_0s.png)
Python Django实现个人博客系统的搭建
2021-12-17 15:04:58
![](https://img.aspxhome.com/file/2023/1/131701_0s.png)
mysql使用source 命令乱码问题解决方法
2024-01-13 13:11:16
python之array赋值技巧分享
2021-11-23 17:16:55
手机浏览器唤起微信分享(JS)
2024-04-19 09:56:18
Python接入MySQL实现增删改查的实战记录
2023-08-23 04:52:50
MySQL运行状况查询方式介绍
2024-01-26 03:54:52
![](https://img.aspxhome.com/file/2023/7/124887_0s.gif)
用asp给网站添加rss聚合功能
2007-11-05 19:08:00
js几个不错的函数 $$()
2024-04-29 13:41:11
基于JavaScript实现的插入排序算法分析
2024-04-16 08:55:36
![](https://img.aspxhome.com/file/2023/8/136818_0s.png)
vue2.0.js的多级联动选择器实现方法
2024-04-28 09:23:37
Mysql教程分组排名实现示例详解
2024-01-18 14:19:49
![](https://img.aspxhome.com/file/2023/7/119767_0s.png)
Jsp+Servlet实现文件上传下载 删除上传文件(三)
2023-06-27 16:29:29
![](https://img.aspxhome.com/file/2023/0/96050_0s.png)