Issue building cx_Oracle - libclntsh.so.11.1 => not found

假装没事ソ 提交于 2019-11-30 05:56:36
Meitham

Add /apps/oracle/client/11.2.0.1/home1/lib/ to your LD_LIBRARY_PATH environment variable execute the command below in the terminal before running python or add it into your .bashrc

export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/apps/oracle/client/11.2.0.1/home1/lib/

Yes. You forgot to tell your loader cache tool that it needs to look in that directory for libraries. Add that directory to /etc/ld.so.conf or a similar file and run ldconfig.

Many oracle products install oraenv. It will set, among other environment variables, LD_LIBRARY_PATH, so consider running . oraenv instead of setting your environment manually.

Set the LD_RUN_PATH. ( LD_RUN_PATH is used by the linker to specify where to look for libraries only at run time.)

Now build cx_Oracle.

/mypath/cx_Oracle-5.1.1]$ export LD_RUN_PATH="/apps/oracle/client/11.2.0.1/home1/lib"
/mypath/cx_Oracle-5.1.1]$ python2.7 setup.py build

This will not require the setting of LD_LIBRARY_PATH while importing cx_Oracle.

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