1.oracle官网下载两个zip包,11或者12c版本应该都可以
instantclient-basic-linux.x64-11.2.0.4.0.zip
instantclient-sdk-linux.x64-11.2.0.4.0.zip
2.上传安装包至/root,unzip解压
unzip ./instantclient-basic-linux.x64-11.2.0.4.0.zip
unzip -o ./instantclient-sdk-linux.x64-11.2.0.4.0.zip
3.设置环境变量,拷贝动态库
export ORACLE_HOME=/root/instantclient_11_2/
cp -rf /root/instantclient_11_2/lib* /usr/lib/
ln -sv /root/instantclient_11_2/libclntsh.so.11.1 /usr/lib/libclntsh.so
4.安装cx_oracle
pip install cx_oracle==5.3
时间: 2024-09-29 07:46:07