(cx_Oracle.DatabaseError) DPI-1047: Cannot locate a 64-bit Oracle Client library:
Posted Data+Science+Insight
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了(cx_Oracle.DatabaseError) DPI-1047: Cannot locate a 64-bit Oracle Client library:相关的知识,希望对你有一定的参考价值。
(cx_Oracle.DatabaseError) 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
(Background on this error at: https://sqlalche.me/e/14/4xp6)
目录
问题:
# python连接orcale数据库,oracle需要本地的客户端支撑;
from sqlalchemy import create_engine
from sqlalchemy.orm import sessionmaker
from sqlalchemy.ext.declarative import declarative_base
from sqlalchemy import Column, Integer, String, DateTime, Boolean,Float
class OracleDB(object):
Base = declarative_base()
def __init__(self,user='xxx',password='xxx',dabatase='xxx',serverip='10.10.10.10',port='1000'):
user = user #'root'
password = password
database = dabatase
serverip = serverip
dns = cx_Oracle.makedsn(serverip, port, service_name=dabatase)
self.engine = create_engine("oracle://"+user+":"+password+"@" + dns, encoding='utf-8', echo=True)
# Session = sessionmaker(bind=self.engine)
# self.session = Session()
def getEngine(self):
return self.engine
解决:
安装对应的oracle版本的client:
执行SQL查询获取oracle版本信息:
SQL> SELECT * FROM v$version;
BANNER
BANNER_FULL
BANNER_LEGACY CON_ID
Oracle Database 19c Enterprise Edition Release 19.0.0.0.0 - Production Version 19.8.0.0.0
我们就去下载19c对应的client文件:
可以从百度云或者csdn下载;
或者从orcale官网下载,不过注意oracle官网下载需要注册;
完整问题:
(cx_Oracle.DatabaseError) 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
(Background on this error at: https://sqlalche.me/e/14/4xp6)
(cx_Oracle.DatabaseError) 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
(Background on this error at: https://sqlalche.me/e/14/4xp6)
......
.....................
参考:Oracle / PLSQL: Checking Oracle Version Information
参考:[ORACLE]ORACLE19 client 安装
参考:1. Oracle19C-client客户端-database数据库-下载-安装-一站式服务-内有多种获取方式(百度网盘+官方)任君选择
以上是关于(cx_Oracle.DatabaseError) DPI-1047: Cannot locate a 64-bit Oracle Client library:的主要内容,如果未能解决你的问题,请参考以下文章
python 3.6 cx_Oracle.DatabaseError: DPI-1050
(cx_Oracle.DatabaseError) DPI-1047: Cannot locate a 64-bit Oracle Client library:
python用cx_Oracle连接数据库,出现错误cx_Oracle.DatabaseError: DPI-1047: Cannot locate a 64-bit Oracle Client li
cx_Oracle.DatabaseError: ORA-28759: failure to open file
Linux下使用Python连接Oracle 报cx_Oracle.DatabaseError: DPI-1047: 64-bit Oracle Client library cannot be lo
已经配好64位的oracle instantclient,依旧Python报错cx_Oracle.DatabaseError: DPI-1047: Cannot locate a 64-bit Ora