0

I need to deploy my python APIs in PCF, but facing issues in accessing the cx_Oracle library when deploying.

Steps I have done until now:-

  1. Unzipped the Oracle Instant Client(Linux) in a folder named "oracle" under my project.
  2. Added these to .profile
LD_LIBRARY_PATH=/c/Documents/project_name/oracle/instantclient_21_1:${LD_LIBRARY_PATH:-} 
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/c/Documents/project_name/oracle/instantclient_21_1 
export OCI_LIB_DIR=/c/Documents/project_name/oracle/instantclient_21_1 
export OCI_INC_DIR=/c/Documents/project_name/oracle/instantclient_21_1/sdk/include

Even after this I am getting the following error:

"DPI-1047: Cannot locate a 64-bit Oracle Client library: "libclntsh.so: cannot open shared object file: No such file or directory". See https://cx-oracle.readthedocs.io/en/latest/user_guide/installation.html for help"

  • Check comments in https://stackoverflow.com/questions/66781781/how-to-access-cx-oracle-on-pivotal-cloud-factory-pcf. Side comment: remove the OCI_*_DIR variables - they are not used by cx_Oracle or Oracle Instant Client. – Christopher Jones May 21 '21 at 00:54
  • If you are using `/c/Documents/project_name` as the path to your extracted Oracle client files, that's not correct. It should be `/home/vcap/app/oracle/...`. Your application files when extracted inside the container on CF will exist under `/home/vcap/app`. Or use `$HOME`, that also points to your app files. – Daniel Mikusa May 21 '21 at 13:49

1 Answers1

1

Try using below in your .profile file: Assuming you have oracle linux client in your root folder

export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$HOME/oracle/instantclient_21_1
export PATH=$PATH:$HOME/oracle/instantclient_21_1

arjain13
  • 556
  • 3
  • 9