how to set oracle client library path in python when multiple oracle client version installed

帅比萌擦擦* 提交于 2019-12-13 08:38:05

问题


i have 2 oracle client installed in linux machine. 10.2 and 12.2. Second one i have to use for cx_oracle and older one is needed for other older implementation which i cant touch.

when i add second 12.2 oracle client library in LD_LIBRARY_PATH path and running simple oracle connection python program, it is giving me below error

cx_Oracle.DatabaseError: DPI-1050: Oracle Client library is at version 10.2 but must be at version 11.2 or higher

How can i use the newer version of client library without touching the old config?


回答1:


Write a shell script that lists the 12.2 Oracle Client library in LD_LIBRARY_PATH before other Oracle libraries, and then invokes Python.

#!/bin/sh
export LD_LIBRARY_PATH=/opt/oracle/instantclient_12_2
python "$@"


来源:https://stackoverflow.com/questions/53520730/how-to-set-oracle-client-library-path-in-python-when-multiple-oracle-client-vers

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!