在redhat上装cx_Oracle,运行完
python setup.py build
python setuo.py install
之后,在python脚本中执行
import cx_Oracle
出现了下面的错误
ImportError: libclntsh.so.11.1: cannot open shared object file: No such file or directory
在网上找了一下,解决办法如下:
cd ~
vi .bash_profile
在.bash_profile中添加
LD_LIBRARY_PATH=$ORACLE_HOME/lib:/usr/lib:/usr/local/lib
export LD_LIBRARY_PATH
然后保存。再执行:
Social tagging: Linux > Oracle > Python > 数据库 > 编程
source .bash_profile
Bravo~问题解决了~