0

I have installed Oracle Instant Client 11.2.0.4 on Ubuntu, and already set the Oracle enviroment variables, and SQL*Plus is working, but running the command "pip install cx_oracle" failed.

The full error message is:

~$ pip install cx_Oracle
Collecting cx-Oracle
  Using cached cx_Oracle-5.2.1.tar.gz
Building wheels for collected packages: cx-Oracle
  Running setup.py bdist_wheel for cx-Oracle ... error
  Complete output from command /home/snyder/anaconda3/bin/python -u -c "import setuptools, tokenize;__file__='/tmp/pip-build-v_mqkgu3/cx-Oracle/setup.py';exec(compile(getattr(tokenize, 'open', open)(__file__).read().replace('\r\n', '\n'), __file__, 'exec'))" bdist_wheel -d /tmp/tmpewk056lgpip-wheel- --python-tag cp35:
  running bdist_wheel
  running build
  running build_ext
  building 'cx_Oracle' extension
  creating build
  creating build/temp.linux-x86_64-3.5-11g
  gcc -pthread -Wsign-compare -Wunreachable-code -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -fPIC -I/usr/include/oracle/11.2/client64 -I/home/snyder/anaconda3/include/python3.5m -c cx_Oracle.c -o build/temp.linux-x86_64-3.5-11g/cx_Oracle.o -DBUILD_VERSION=5.2.1
  In file included from /usr/include/oracle/11.2/client64/oci.h:3045:0,
                   from cx_Oracle.c:10:
  /usr/include/oracle/11.2/client64/ociap.h:10795:1: warning: function declaration isn’t a prototype [-Wstrict-prototypes]
   void OCIThreadProcessInit();
   ^
  /usr/include/oracle/11.2/client64/ociap.h:10801:1: warning: function declaration isn’t a prototype [-Wstrict-prototypes]
   boolean OCIThreadIsMulti();
   ^
  In file included from Variable.c:176:0,
                   from Cursor.c:246,
                   from Connection.c:761,
                   from SessionPool.c:138,
                   from cx_Oracle.c:203:
  ObjectVar.c: In function ‘ObjectVar_Initialize’:
  ObjectVar.c:118:19: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
       for (i = 0; i < self->allocatedElements; i++) {
                     ^
  ObjectVar.c: In function ‘ObjectVar_Finalize’:
  ObjectVar.c:135:19: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
       for (i = 0; i < self->allocatedElements; i++) {
                     ^
  In file included from Cursor.c:246:0,
                   from Connection.c:761,
                   from SessionPool.c:138,
                   from cx_Oracle.c:203:
  Variable.c: In function ‘Variable_NewByOutputTypeHandler’:
  Variable.c:926:32: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
       if (var->allocatedElements < cursor->fetchArraySize) {
                                  ^
  In file included from Connection.c:764:0,
                   from SessionPool.c:138,
                   from cx_Oracle.c:203:
  Subscription.c: In function ‘MessageTable_Initialize’:
  Subscription.c:451:19: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
       for (i = 0; i < numRows; i++) {
                     ^
  Subscription.c: In function ‘MessageQuery_Initialize’:
  Subscription.c:526:19: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
       for (i = 0; i < numTables; i++) {
                     ^
  Subscription.c: In function ‘Message_Initialize’:
  Subscription.c:618:23: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
           for (i = 0; i < numTables; i++) {
                         ^
  Subscription.c:660:23: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
           for (i = 0; i < numQueries; i++) {
                         ^
  cx_Oracle.c: In function ‘Variable_GetArrayValue’:
  cx_Oracle.c:595:1: internal compiler error: 非法指令
   }
   ^
  Please submit a full bug report,
  with preprocessed source if appropriate.
  See <file:///usr/share/doc/gcc-5/README.Bugs> for instructions.
  error: command 'gcc' failed with exit status 1

The important bit seems to be (with error translated):

  cx_Oracle.c:595:1: internal compiler error: Illegal Instruction
   }
   ^
  Please submit a full bug report,
  with preprocessed source if appropriate.
  See <file:///usr/share/doc/gcc-5/README.Bugs> for instructions.
  error: command 'gcc' failed with exit status 1

How can I fix this?

Alex Poole
  • 183,384
  • 11
  • 179
  • 318
snyder
  • 1
  • my python is 3.5 , system is ubuntu , oracle is 11.2.0.4 instant client – snyder Mar 09 '16 at 10:39
  • i can use sqlplus successfully on my ubuntu – snyder Mar 09 '16 at 10:40
  • Looks like a problem with your gcc installation rather than cx_oracle, [as seen here](http://stackoverflow.com/q/16526493/266304); check you have the current version of gcc and related tools and libraries. – Alex Poole Mar 09 '16 at 11:55
  • I was getting a similar error on a fresh install of Fedora. Make sure you have the devel tools installed. Not sure if it's the same names for ubuntu but on Fedora I did dnf install python-devel python3-devel libevent-devel – Diver Mar 09 '16 at 22:24
  • alex poole is right,i reisntall the gcc,now it can run – snyder Mar 15 '16 at 06:20

0 Answers0