Skip to content

Version 6 fails to find OCI libs where version 5 succeeded #15

@tlandschoff-scale

Description

@tlandschoff-scale

We are preparing to replace cx_Oracle 5 with version 6 in our application. Updating the requirements lead to our tests to fail.

The reason is quite obvious but I think cx_Oracle 5 was more robust: On our build slave the instantclient packages are installed but nothing else of the Oracle database. This always worked fine:

(venv) (python27)[jenkins@build-rhel6-v2 ~]$ pip install cx_Oracle==5.3
Collecting cx_Oracle==5.3
[...]
Successfully installed cx-Oracle-5.3
(venv) (python27)[jenkins@build-rhel6-v2 ~]$ python -c "import cx_Oracle; print cx_Oracle.version"
5.3

After upgrading to 6.0b1 we get this:

(venv) (python27)[jenkins@build-rhel6-v2 ~]$ pip install cx_Oracle==6.0b1
Collecting cx_Oracle==6.0b1
Installing collected packages: cx-Oracle
  Found existing installation: cx-Oracle 5.3
    Uninstalling cx-Oracle-5.3:
      Successfully uninstalled cx-Oracle-5.3
Successfully installed cx-Oracle-6.0b1
(venv) (python27)[jenkins@build-rhel6-v2 ~]$ python -c "import cx_Oracle; print cx_Oracle.version"
Traceback (most recent call last):
  File "<string>", line 1, in <module>
cx_Oracle.DatabaseError: DPI-1047: 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 for help

The version of instant client installed is a bit old:

(venv) (python27)[jenkins@build-rhel6-v2 ~]$ rpm -qa|grep instant
oracle-instantclient11.2-basic-11.2.0.3.0-1.x86_64
oracle-instantclient11.2-devel-11.2.0.3.0-1.x86_64
(venv) (python27)[jenkins@build-rhel6-v2 ~]$ rpm -ql oracle-instantclient11.2-basic-11.2.0.3.0-1.x86_64|grep libclnt
/usr/lib/oracle/11.2/client64/lib/libclntsh.so.11.1

The obvious way to fix this is to extend LD_LIBRARY_PATH:

$ LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/usr/lib/oracle/11.2/client64/lib python -c "import cx_Oracle; print cx_Oracle.version"
6.0b1

For easing the upgrade to users of cx_Oracle it would make sense though to keep the behaviour to guess the instant client installations like setup.py did for cx_Oracle 5.3.

Feel free to close this if you disagree.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions