[oracle@obi11-01 instantclient_12_1]$ sudo pip install cx_Oracle
Downloading/unpacking cx-Oracle
Running setup.py egg_info for package cx-Oracle
Traceback (most recent call last):
File "<string>", line 16, in <module>
File "/tmp/pip-build-root/cx-Oracle/setup.py", line 170, in <module>
raise DistutilsSetupError("cannot locate an Oracle software " \
distutils.errors.DistutilsSetupError: cannot locate an Oracle software installation
Complete output from command python setup.py egg_info:
Traceback (most recent call last):
File "<string>", line 16, in <module>
File "/tmp/pip-build-root/cx-Oracle/setup.py", line 170, in <module>
raise DistutilsSetupError("cannot locate an Oracle software " \
distutils.errors.DistutilsSetupError: cannot locate an Oracle software installation
The problem was running as sudo all of the environment variables (ORACLE_HOME etc) were not actually available in the context. As a hack I just chmod'd the target site-packages folder that pip was trying to write to, and ran as the oracle user, not sudo
Also make sure you have instant client basic and sdk.
Do you mind elaborating what you mean when you "ran as the oracle user"? Thanks!