python连oracle DPI-1047: Cannot locate a 64-bit Oracle Client library: "The specified module could...

import pandas as pd

import cx_Oracle

#连接数据库

#user/password@dbname

conn = cx_Oracle.connect('账号/密码@库名')

#创建cursor

cursor = conn.cursor()


1. 可能原因:python,oracle一个是32位,一个是64位

查看oracle:

Help---Support_info



显示为64位,没问题

2. 下载client,下载地址http://jvniu.jb51.net:81/201708/tools/instantclientx64_jb51.rar

将新的client放到oracle文件夹中


3. 添加环境变量:C:\Program Files (x86)\Oracle\instantclient_11_2

3.1 计算机--系统属性


3.2


3.3


3.4


关闭Spyder之后再运行,还是报错

再oracle下面创建product文件夹,并把client文件放置在下面


将所有.dll后缀的文件夹考到Ancona安装目录下


拷贝到这个文件下


关闭Spyder,再度运行,即可。

你可能感兴趣的:(python连oracle DPI-1047: Cannot locate a 64-bit Oracle Client library: "The specified module could...)