ubuntu install cx_Oracle

1. install ubuntu oracle client

2. add environment

gedit /etc/environment append

export ORACLE_HOME=/usr/lib/oracle/xe/app/oracle/product/10.2.0/client

export LD_LIBRARY_PATH=/usr/lib/oracle/xe/app/oracle/product/10.2.0/client/lib:$LD_LIBRARY_PATH

or gedit .bashrc

3. download cx_Oracle

4. 修改cx_Oracle的 setup.py文件

# try to determine the Oracle home
#userOracleHome = os.environ.get("ORACLE_HOME")
userOracleHome = "/usr/lib/oracle/xe/app/oracle/product/10.2.0/client"

5. sudo python setup.py install 

6.编辑/etc/ld.so.conf

编辑/etc/ld.so.conf

vim /etc/ld.so.conf

在最后一行输入获取的路径

/usr/lib/oracle/xe/app/oracle/product/10.2.0/client/lib/

执行

sudo ldconfig


你可能感兴趣的:(oracle,python,ubuntu,Path,download,library)