1

version: python2.7

attempting to install cx_oracle

Collecting cx_Oracle Using cached cx_Oracle-5.3.tar.gz Complete output from command python setup.py Traceback (most recent call last): File "", line 1, in File "C:\Users\Test\AppData\Local\Temp\pycharm-packaging\cx-Oracle\setup.py", line 190, in raise DistutilsSetupError(message) distutils.errors.DistutilsSetupError: cannot locate Oracle include files in C:\new_software\Oracle\instantclient_12_1 Command "python setup.py egg_info" failed with error code 1 in C:\Users\Test\AppData\Local\Temp\pycharm-packaging\cx-Oracle\

I have installed oracle client 12_1 and set Oracle Home and PATH variables on Windows10.

python2.7 is installed and within python27/scripts/ , I see pip.exe

I get below error when i tried running:

C:\new_software\Python27\Scripts>pip install cx_Oracle failed to create process.

Request help. Thanks.

3
  • Did you check that C:\new_software\Oracle\instantclient_12_1 actually has the include (.h) files? Commented Apr 20, 2017 at 13:56
  • no i don't see it. Commented Apr 20, 2017 at 14:01
  • Currently facing the below error: cx_Oracle.obj : error LNK2019: unresolved external symbol _OCISessionPoolCreate referenced in function _SessionPool_Init build\lib.win32-2.7-12c\cx_Oracle.pyd : fatal error LNK1120: 109 unresolved externals error: command 'C:\\Users\\User1\\AppData\\Local\\Programs\\Common\\Microsoft\\Visual C++ for Python\\9.0\\VC\\Bin\\link.exe' failed with exit status 1120 Commented Apr 22, 2017 at 13:02

1 Answer 1

2

For cx_Oracle 5.x you need to have the SDK package of the instant client installed on your machine in order to build.

cx_Oracle 6.x, however, doesn't require that package at all. In fact, binary wheels are available so you don't need to compile anything at all! You can install the first beta of this version by using this command:

pip install cx_Oracle --pre

You can also download and install a pre-compiled binary from PyPI.

Sign up to request clarification or add additional context in comments.

7 Comments

Thanks Anthony, happy to hear from creator of cx_Oracle. I got past that issue, and then had to install Visual c++ after that it still fails with the error. I have updated the question with new error. request your help.
\instantclient_12_1\sdk\lib\msvc/LIBPATH:C:\new_software\Python27\PC\VS9.0 oci.lib /EXPORT:initcx_Oracle build\temp.win32-2.712c\cx_Oracle.pyd /IMPLIB:build\temp.win32-2.7-12c\Release\src\cx_Oracle.lib /MANIFESTFILE:build\temp.win32-2.7-12c\Release\src\cx_Oracle.pyd.manifest Creating library build\temp.win32-2.7-12c\Release\src\cx_Oracle.lib and object build\temp.win32-2.7-12c\Release\src\cx_Oracle.exp cx_Oracle.obj : error LNK2019: unresolved external symbol _OCIAttrGet referenced in function _Error_InternalNew
cx_Oracle.obj : error LNK2019: unresolved external symbol _OCISessionPoolCreate referenced in function _SessionPool_Init build\lib.win32-2.7-12c\cx_Oracle.pyd : fatal error LNK1120: 109 unresolved externals error: command 'C:\\Users\\User1\\AppData\\Local\\Programs\\Common\\Microsoft\\Visual C++ for Python\\9.0\\VC\\Bin\\link.exe' failed with exit status 1120
I updated my answer to suggest that you download and install a precompiled binary. :-)
Thanks @Anthony Tuininga. I was able to install it successfully. But getting the below error and i already see a post of yours: github.com/oracle/python-cx_Oracle/issues/15 let me try setting LD_LIBPATH from my end. pls let me know of any thoughts. cx_Oracle.DatabaseError: DPI-1047: Oracle Client library cannot be loaded: %1 is not a valid Win32 application.
|

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.