linux Server running python-cx_Oracle:DPI-1047:cannot locate a 64-bit oracle client library:“libclntsh.so“ terms of settlement _Gluttony-- The blog of -CSDN Blog
I've really searched all over the blog , It's not done until you throw up .
stay linux Server , Use python3 Connect oracle
linux edition centos 6.5 x86_64 64 Bit
python3.7
1、 download instantclient-basic-linux.x64-12.2.0.1.0.zip
Download address :
Instant Client for Linux x86-64 (64-bit)
2、 stay opt Under the new oracle file
mkdir -p /opt/oracle
cd /opt/oracle
3、 take instantclient-basic-linux.x64-12.2.0.1.0.zip Put it in oracle Under the document
a、 take instantclient-basic-linux.x64-12.2.0.1.0.zip Put it in oracle Under the document
b、 decompression
unzip instantclient-basic-linux.x64-12.2.0.1.0.zip
Establishing a connection , Just execute the following commands in sequence
cd /opt/oracle/instantclient_12_2
ln -s libclntsh.so.12.1 libclntsh.so
ln -s libocci.so.12.1 libocci.so
sudo sh -c "echo /opt/oracle/instantclient_12_2 > /etc/ld.so.conf.d/oracle-instantclient.conf"
sudo ldconfig
pip3 install cx_Oracle==8.3.0
----------------------------- That's it -----------------------------
4.1 cx_Oracle.DatabaseError: ORA-24454: The client hostname is not set
One line of instructions to solve
sudo /bin/bash -c "echo '127.0.1.1 ${HOSTNAME}' >> /etc/hosts"
When not installed instantclient when , perform python The script will report an error .
Prompt you to follow https://cx-oracle.readthedocs.io/en/latest/user_guide/installation.html
This connection to solve , I tried the method of this connection for half a day , It's not done , Finally, I got it with my blog .
I guess it must be the version , Last use 12 The version of is done .