As bschulz explains, this problem is usually resolved using the environment variables ORACLE_HOME and LD_LIBRARY_PATH to ensure that gcc can access header files. In my case, this did not solve the problem, but the error check was given to me by a hint to solve the problem.
Executing pip cx_Oracle installation showed this error:
gcc -pthread -fno-strict-aliasing -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector --param=ssp-buffer-size=4 -m64 -mtune=generic -D_GNU_SOURCE -fPIC -fwrapv -DNDEBUG -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector --param=ssp-buffer-size=4 -m64 -mtune=generic -D_GNU_SOURCE -fPIC -fwrapv -fPIC -I/home/oracle/product/12.1.0/rdbms/demo -I/home/oracle/product/12.1.0/rdbms/public -I/usr/include/python2.7 -c cx_Oracle.c -o build/temp.linux-x86_64-2.7-12c/cx_Oracle.o -DBUILD_VERSION=5.2.1 cx_Oracle.c:10:17: error: oci.h: No such file or directory cx_Oracle.c:11:18: error: orid.h: No such file or directory cx_Oracle.c:27:2: error:
Search for -I flag in man gcc:
-I dir Add the directory dir to the list of directories to be searched for header files. ....
So the problem was with these flag values:
-I/home/oracle/product/12.1.0/rdbms/demo -I/home/oracle/product/12.1.0/rdbms/public -I/usr/include/python2.7
I cannot say why the -I flag was set for these values, but an easy way to make it work is to change the flag that passes the correct values ββfrom the pip command line:
pip install cx_Oracle --global-option=build_ext --global-option="-I/home/oracle/instantclient_12_1/sdk/include"
Thus, the new -I value is sent to gcc, and the installation ends correctly.
source share