cx_Oracle.DatabaseError:DPI-1047:无法加载64位Oracle Client库:“ dlopen(libclntsh.dylib,1):找不到映像” [英] cx_Oracle.DatabaseError: DPI-1047: 64-bit Oracle Client library cannot be loaded: "dlopen(libclntsh.dylib, 1): image not found"

查看:128
本文介绍了cx_Oracle.DatabaseError:DPI-1047:无法加载64位Oracle Client库:“ dlopen(libclntsh.dylib,1):找不到映像”的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试设置 cx_Oracle 以使用Python。

I am trying to set up cx_Oracle to work with Python.

我正在使用


  • Python 2.7.10,64位

  • cx_Oracle 版本6.0.2

  • MacOS Sierra 10.12.6

  • Python 2.7.10, 64-bit
  • cx_Oracle version 6.0.2
  • MacOS Sierra 10.12.6

我设置了以下环境变量:

I set the following environment variables:

export ORACLE_HOME="/Volumes/DATA/Programs/PY/instantclient_12_1"
export DYLD_LIBRARY_PATH="$ORACLE_HOME:$DYLD_LIBRARY_PATH"
export LD_LIBRARY_PATH=$ORACLE_HOME
export PATH=$PATH:$ORACLE_HOME
export ORACLE_SID=edocd
export TNS_ADMIN=/Volumes/DATA/Programs/PY/instantclient_12_1/network/admin
export TWO_TASK=${ORACLE_SID}

这是我尝试的方法:


  1. 以管理员身份安装

  2. sudo python setup.py build

  3. sudo python setup.py install

  1. Installed as Administrator
  2. sudo python setup.py build
  3. sudo python setup.py install

当我尝试执行时一个简单的脚本来检查我是否能够通过 sqlplus 成功连接到Oracle。

When I tried to execute a simple script to check the Oracle connection I was able to connect successfully via sqlplus.

这是错误我收到:


cx_Oracle.DatabaseError:DPI-1047:无法加载64位Oracle客户端库: dlopen(libclntsh.dylib, 1):找不到图片。请参见 https://oracle.github.io/odpi/doc/installation.html# macos 获得帮助


推荐答案

我针对Ubuntu 16.04(64位)的解决方案)

tl; dr: /doc/installation.html#macos rel = noreferrer>官方指南:

A tl;dr: of the official guide:

1)下载 instantclient-basic-linux.x64-12.2.0.1.0.zip

2)将其提取到/ opt / oracle目录:

2) Extract it to /opt/oracle directory:

$ sudo mkdir -p /opt/oracle
$ cd /opt/oracle
$ unzip ~/Downloads/instantclient-basic-linux.x64-12.2.0.1.0.zip

3)安装 libaio 程序包

$ sudo apt-get install libaio1

4)编辑 oracle-instantclient.conf 像这样的文件:

4) Edit the oracle-instantclient.conf file like so:

$ sudo sh -c "echo /opt/oracle/instantclient_12_2 > /etc/ld.so.conf.d/oracle-instantclient.conf"
$ sudo ldconfig

这篇关于cx_Oracle.DatabaseError:DPI-1047:无法加载64位Oracle Client库:“ dlopen(libclntsh.dylib,1):找不到映像”的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆