python3 install oracle client on linux to solve the dependency problem of cx_oracle

1. Install oracle client

linux:

https://www.cnblogs.com/chenjianhong/archive/2013/06/08/4144771.html

(1) Download client

https://www.oracle.com/database/technologies/instant-client/linux-x86-64-downloads.html

I use 11.2 version as an example

(2) After decompression, copy and rename libclntsh.so.11.1 to libclntsh.so

Required documents: https://wws.lanzous.com/iAWZuktckkb

(3) Copy all files to /usr/lib

- If an error is reported, there is no libaio.so.1 file

-- apt-get update 再  apt-get install libaio1 libaio-dev

-- 或 yum install libaio

 

win10:

Copy the file to the lib path

- View lib path

-- import sys

-- sys.path

Required documents: https://wws.lanzous.com/iTtcqktcmng

 

 

2. Install cx_oracle

linux:

pip install cx-Oracle

 

win10:

At that time, pip installation reported an error

Change to the official download whl file, and then install

-- pip install xxx.whl

-- pip uninstall xxx.whl

https://pypi.org/project/cx-Oracle/#history

 

 

 

import cx_Oracle
conn = cx_Oracle.connect('c##admin/[email protected]/orcl')
# conn = cx_Oracle.connect('user/passwd@host/instance')

Guess you like

Origin blog.csdn.net/u013595395/article/details/113108008