首先确定pthon版本和oracle客户端版本一致即可,即都为64位或都为32位。

但我这里要讲的是如何解决这个问题的过程:

在python中的报错中提示了这个:

DPI-1047: Cannot locate a 64-bit Oracle Client library: “The specified module could not be found”. See https://cx-oracle.readthedocs.io/en/latest/user_guide/installation.html for help

第一种方法:
去https://cx-oracle.readthedocs.io/en/latest/user_guide/installation.html 这里找资料。根据文档中的方法,我们可以看到这个:

cx_Oracle.init_oracle_client() to set the Oracle Client directory:
import cx_Oracle
import sys
import os

try:
if sys.platform.startswith(“darwin”):
lib_dir = os.path.join(os.environ.get(“HOME”), “Downloads”,
“instantclient_19_8”)
cx_Oracle.init_oracle_client(lib_dir=lib_dir)
elif sys.platform.startswith(“win32”):
lib_dir=r"C:\oracle\instantclient_19_9"
cx_Oracle.init_oracle_client(lib_dir=lib_dir)
except Exception as err:
print(“Whoops!”)
print(err);
sys.exit(1);
使用这个的好处是:不用到处去设置变量让cx_Oracle去查找oracle client的路径。

第二种方法:
import os

设置环境变量:ORACLE驱动位置

os.environ[‘path’] = r’D:\soft\navicate\navicat\Navicat Premium 15\instantclient_11_2’

将这个instantclient_11_2文件路径,换成自己的路径就行,我使用navicat连接过,所以可以在navicat中找到这个文件,替换路径即可。

两种方法的含义是一样的

cx_Oracle.DatabaseError: DPI-1047: Cannot locate a 64-bit Oracle Client library:相关推荐

  1. python cx_Oracle.DatabaseError: DPI-1047: Cannot locate a 64-bit Oracle Client library

    问题: python 使用包cx_Oracle连接Oracle数据,出现错误cx_Oracle.DatabaseError: DPI-1047: Cannot locate a 64-bit Orac ...

  2. cx_Oracle.DatabaseError: DPI-1047: 64-bit Oracle Client library cannot be loaded 解决方法

    cx_Oracle.DatabaseError: DPI-1047: 64-bit Oracle Client library cannot be loaded 解决方法 参考文章: (1)cx_Or ...

  3. cx_Oracle.DatabaseError: DPI-1072: the Oracle Client library version is unsupported 已解决

    python3在使用cx_Oracle的时候报错了,并且是一致都好好的,突然就报错. Traceback (most recent call last):File "D:/python/wo ...

  4. DPI-1047:Cannot locate a 64-bit Oracle Client library:The specified module could not be found

    解决python cx_Oracle模块DPI-1047:Cannot locate a 64-bit Oracle Client library: 通过python的cx_Oracle模块连接服务器 ...

  5. [解决方案]Windows系统报错cx_Oracle.DatabaseError: DPI-1072: the Oracle Client library version is unsupported

    安装好instantclient https://pan.baidu.com/s/1lMo3v0wluy1rMoK26o0A9A 复制dll 将安装好的instantclient目录下的所有dll复制 ...

  6. python-cx_oracle报错“DatabaseError: DPI-1047: 64-bit Oracle Client library cannot be loaded: “

    问题的主要原因是python-cx_oracle加载的是32位的instantclient-basic,我们需要让他读到64位的. 弄清版本,最重要!!! 首先安装配置时,必须把握一个点,就是版本一致 ...

  7. 判断oracle客户端是32还是64,64位-如何知道已安装的Oracle Client是32位还是64位?

    64位-如何知道已安装的Oracle Client是32位还是64位? 操作系统:Windows 2008 Server R2 Oracle客户端:11.2 非常感谢 8个解决方案 73 votes ...

  8. cx_Oracle.DatabaseError: DPI-1047: Cannot locate a 64-bit O

    在使用python连接oracle的时候,出现以上错误,如果本地有安装oracle的客户端的话,可以参考这个博客进行解决, 使用cx_Oracle连接数据库时报错: cx_Oracle.Databas ...

  9. cx_Oracle.DatabaseError: ORA-01036: 非法的变量名/编号

    #-*-coding:utf-8-*- #encoding=gbkimport os import cx_Oracle import xlrd os.environ['NLS_LANG'] = 'SI ...

最新文章

  1. Windows 2003系统也玩图片收藏屏保
  2. Android中发送和接收短信
  3. 图像处理:二维傅里叶变化的平移性_matlab实现
  4. Python基本语法元素之温度转换
  5. BEGIN-4 Fibonacci数列
  6. LiveVideoStackCon 2020上海 6月见
  7. object中的toString方法
  8. 灰度测试试验流量“洗牌”
  9. linux中显示进程,linux中怎么显示所有进程
  10. OpenShift 4 - DevSecOps Workshop (8) - 为Pipeline增加生成Image任务
  11. 新物联网时代的整合战略
  12. 国家统计局长称今年经济增速可能超去年
  13. Failed to apply plugin [id 'com.gradle.build-scan']
  14. Python实现圣诞树、打包exe过程和遇到的问题
  15. 更新被拒绝,因为远程仓库包含您本地尚不存在的提交
  16. [CC2642r1][syscfg] 中文图形化界面,方便快速熟悉工具使用
  17. 堆排序稳定性举例_稳定排序和不稳定排序
  18. 干货满满的一次ctf
  19. 考取华为HCIA证书需要什么流程,报培训班加考试费大概需要多少钱?
  20. spring boot+iview 前后端分离架构之文件上传的实现(三十一)

热门文章

  1. 19年Macbook pro type-c 供电问题,鼠标,u盘失灵,推展坞用不了。
  2. 移动端实现左右菜单联动效果(vue+better-scroll)
  3. VLAN配置(IN8000系列交换机)
  4. http服务搭建,搭建web服务器
  5. 怎么在网页上远程看监控?——云视通websdk的使用
  6. 自主研发数据库TDSQL和TBase核心架构揭秘和实践
  7. 不小心清空了回收站怎么恢复文件 回收站清空的文件怎么恢复
  8. 期货:移动平均线(MA)技术指标图形
  9. mysql front的命令_mysql-front远程连接自己linux服务器上的mysql服务器
  10. iOS开发中的UDID和UUID详解