ubuntu oracle 连接工具,Ubuntu 16.4安装python3 cx_Oracle链接甲骨文数据库

For Oracle 12.x , cx_Oracle not available yet. So we need to download instant client with 11.x version.

Go to http://www.oracle.com/technetwork/topics/linuxx86-64soft-092277.html and accept License Agreement.

Then download zip files with names as below

instantclient-sdk-linux.x64-11.2.0.4.0.zip

instantclient-basic-linux.x64-11.2.0.4.0.zip

And unzip them with unzip command

unzip instantclient-sdk-linux.x64-11.2.0.4.0.zip

unzip instantclient-basic-linux.x64-11.2.0.4.0.zip

Both will be extracted into a common directory named as "instantclient_11_2". Then add this to PATH with below commands.

export ORACLE_HOME=/path-to_this/instantclient_11_2

cd $ORACLE_HOME

ln -s libclntsh.so.11.1   libclntsh.so

Open /etc/profile or .bashrc and following entries.

export ORACLE_HOME=/location/of/your/files/instantclient_11_2

export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$ORACLE_HOME

then do source ~/.bashrc or source /etc/profile

And install these packages

sudo apt-get install build-essential unzip python-dev libaio-dev

after that use pip or pip3 according to your Python version and then install it

pip3 install cx_Oracle

and try loading cx_Oracle module in Python interpreter.

Hope this helps.

Credit goes here: https://gist.github.com/kimus/10012910

Note: I have tried this on my Ubuntu 16.04 installation , it should work for you.

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值