Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

DPI-1047 on CentOS 7.4 with cx_Oracle 6.4 and Oracle Instant Client 18.3 RPMs #210

Closed
raphattack opened this issue Aug 3, 2018 · 3 comments

Comments

@raphattack
Copy link

  1. What is your version of Python? Is it 32-bit or 64-bit?
    3.6.5 64-bit

  2. What is your version of cx_Oracle?
    6.4.1

  3. What is your version of the Oracle client (e.g. Instant Client)? How was it
    installed? Where is it installed?

18.3
sudo yum install oracle-instantclient18.3-basic-18.3.0.0.0-1.x86_64.rpm
/usr/lib/oracle/18.3/client64/
  1. What is your version of the Oracle Database?
    12.1.0.2.0 - 64-bit

  2. What is your OS and version?
    CentOS Linux release 7.4.1708 (Core)

  3. What compiler version did you use? For example, with GCC, run
    gcc --version.
    gcc (GCC) 4.8.5 20150623 (Red Hat 4.8.5-16)

  4. What environment variables did you set? How exactly did you set them?

~/.bash_profile
export LD_LIBRARY_PATH=/usr/lib/oracle/18.3/client64/lib/
  1. What exact command caused the problem (e.g. what command did you try to
    install with)? Who were you logged in as?
    $ python3 test.py
$ cat test.py
import cx_Oracle

dsn = "myusername/mypassword@localhost:1521/mydb"

conn = cx_Oracle.connect(dsn)
cur = conn.cursor()

  1. What error(s) you are seeing?
cx_Oracle.DatabaseError: DPI-1047: 64-bit Oracle Client library cannot be loaded: "libclntsh.so: cannot open shared object file: No such file or directory". See https://oracle.github.io/odpi/doc/installation.html#linux for help

Per step 3 of this link, I have done:

$ sudo sh -c "echo /usr/lib/oracle/18.3/client64/lib > /etc/ld.so.conf.d/oracle-instantclient.conf"
$ sudo ldconfig
$ cat /etc/ld.so.conf.d/oracle-instantclient.conf
/usr/lib/oracle/18.3/client64/lib

Looking in the directory, libclntsh.so does not exist:

$ ll /usr/lib/oracle/18.3/client64/lib
total 225492
-rwxr-xr-x 1 root   8348633 Jun 28 03:53 libclntshcore.so.18.1
-rwxr-xr-x 1 root  77879517 Jun 28 03:53 libclntsh.so.18.1
-rwxr-xr-x 1 root   3537979 Jun 28 03:53 libipc1.so
-rwxr-xr-x 1 root    467468 Jun 28 03:53 libmql1.so
-rwxr-xr-x 1 root   6636088 Jun 28 03:53 libnnz18.so
-rwxr-xr-x 1 root   2229347 Jun 28 03:53 libocci.so.18.1
-rwxr-xr-x 1 root 126950232 Jun 28 03:53 libociei.so
-rwxr-xr-x 1 root    160875 Jun 28 03:53 libocijdbc18.so
-rwxr-xr-x 1 root    394835 Jun 28 03:53 libons.so
-rwxr-xr-x 1 root    118171 Jun 28 03:53 liboramysql18.so
drwxr-xr-x 3 root      4096 Aug  3 12:12 network
-rw-r--r-- 1 root   4109057 Jun 28 03:54 ojdbc8.jar
-rw-r--r-- 1 root     37519 Jun 28 03:53 xstreams.jar

Is it still required to create a symlink?

Alternatively, setting export LD_LIBRARY_PATH=/usr/lib/oracle/18.3/client64/lib/ in ~/.bash_profile does not seem to solve the issue.

@anthony-tuininga
Copy link
Member

With cx_Oracle 7 (which will be the first version to officially support 18) the symlink won't be needed, but currently it is. Still, the RPM should have created the symlink for you. I'll have to check that out and see if that is a packaging issue or something else that went wrong when you did your install.

@anthony-tuininga
Copy link
Member

I have confirmed that without the symbolic link it does not work (and that the RPM doesn't create the symbolic link) and with it, it does. So the workaround is simple enough. Run these commands as root:

cd /usr/lib/oracle/18.3/client64/lib
ln -s libclntsh.so.18.1 libclntsh.so

@raphattack
Copy link
Author

Thanks for confirming!

@cjbj cjbj closed this as completed Aug 6, 2018
@cjbj cjbj changed the title DPI-1047 on CentOS 7.4 DPI-1047 on CentOS 7.4 with cx_Oracle 6.4 and Oracle Instant Client 18.3 RPMs Aug 6, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants