Reputation: 119
I need to connect to Oracle database using python. So, I did the following:
But when I tried to run import cx_Oracle
I got this error:
ImportError: No module named cx_Oracle
According to cx_Oracle site I need to Place the file cx_Oracle.pyd or cx_Oracle.so anywhere on your Python path. But I can't find those files after installing cx_Oracle-5.1.1-11g-py32-1.x86_64.rpm..
By the way, I also tried to install using zipped version but I got a lot error upon building like error: command 'gcc' failed with exit status 1
Is there anything I did wrong?
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Got it solved guys. I upgraded my python to latest, used cx_Oracle for python33, and instantclient11.2..
Upvotes: 0
Views: 1418
Reputation: 46
1: For your failed building, please give more details. Probably because you don't have the python development headers installed ("python-devel")
2: You need Oracle client installed as well, because cx_Oracle is just a linker between Python and the Oracle Client. Fast way is to get "Instant Client".
From the cx-oracle's README:
Please note that an Oracle client (or server) installation is required in order to use cx_Oracle. If you do not require the tools that come with a full client installation, it is recommended to install the Instant Client which is far easier to install.
Upvotes: 1