本文地址:http://blog.youkuaiyun.com/kongxx/article/details/7107683
在安装了cx_Oracle和Oracle Instant Client软件包之后,使用"import cx_Oracle"导入包的时候出现下面的问题
此时是由于python在操作oracle数据库的时候需要用到oracle的一些库,而上面的问题就是说python需要的这些库不在环境的路径里,在linux上就是不在LD_LIBRARY_PATH环境变量里,此时时就需要把这些库路径加到LD_LIBRARY_PATH中
$ whereis oracle $ export LD_LIBRARY_PATH=${LD_LIBRARY_PATH}:/usr/lib/oracle/11.2/client/lib再次运行测试,上面的问题没有了。参考资料:cx-oracle: http://cx-oracle.sourceforge.net/
Instant Client: http://www.oracle.com/technetwork/database/features/instant-client/index-097480.html
Using Python With Oracle Database 11g: http://www.oracle.com/technetwork/articles/dsl/python-091105.html
本文解决在安装了cx_Oracle和OracleInstantClient后,使用import cx_Oracle导入包时遇到的ImportError:libclntsh.so.10.1:cannot openshared object file问题。通过将必要的Oracle库路径添加到LD_LIBRARY_PATH环境变量,成功解决了该问题。
6548

被折叠的 条评论
为什么被折叠?



