Ubuntu 使用pip安装cx\U oracle时出现非法指令错误

Ubuntu 使用pip安装cx\U oracle时出现非法指令错误,ubuntu,gcc,cx-oracle,Ubuntu,Gcc,Cx Oracle,我已经在Ubuntu上安装了Oracle Instant Client 11.2.0.4,并且已经设置了Oracle环境变量,SQL*Plus正在运行,但是运行命令“pip install cx_Oracle”失败 完整的错误消息是: ~$ pip install cx_Oracle Collecting cx-Oracle Using cached cx_Oracle-5.2.1.tar.gz Building wheels for collected packages: cx-Oracl

我已经在Ubuntu上安装了Oracle Instant Client 11.2.0.4,并且已经设置了Oracle环境变量,SQL*Plus正在运行,但是运行命令“pip install cx_Oracle”失败

完整的错误消息是:

~$ 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
~$pip安装cx\u Oracle
收集cx Oracle
使用缓存的cx_Oracle-5.2.1.tar.gz
为收集的软件包构建控制盘:cx Oracle
正在为cx Oracle运行setup.py bdist\u控制盘。。。错误
从命令/home/snyder/anaconda3/bin/python-u-c“import setuptools,tokenize;uuu file_uuu='/tmp/pip-build-v_mqkgu3/cx Oracle/setup.py';exec(compile)(getattr(tokenize,'open',open)(uuu文件u).read().replace('\r\n','\n'),6lu file,'exec'))”bdist wheel-d/tmp/tmpewk05gpip wheel--标记cp35:
运转的车轮
运行构建
运行build_ext
构建“cx_Oracle”扩展
创建构建
创建build/temp.linux-x86_64-3.5-11g
gcc-pthread-Wsign compare-Wunreachable code-DNDEBUG-g-fwrapv-O3-Wall-Wstrict原型-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
在/usr/include/oracle/11.2/client64/oci.h:3045:0中包含的文件中,
从cx_Oracle.c:10:
/usr/include/oracle/11.2/client64/ociap.h:10795:1:警告:函数声明不是原型[-Wstrict-prototype]
void-OCIThreadProcessInit();
^
/usr/include/oracle/11.2/client64/ociap.h:10801:1:警告:函数声明不是原型[-Wstrict-prototype]
布尔函数是多重的();
^
在变量.c:176:0中包含的文件中,
从游标c:246,
从连接c:761,
来自SessionPool.c:138,
从cx_Oracle.c:203:
ObjectVar.c:在函数“ObjectVar_Initialize”中:
ObjectVar.c:118:19:警告:有符号和无符号整数表达式之间的比较[-Wsign compare]
对于(i=0;iallocateElements;i++){
^
ObjectVar.c:在函数“ObjectVar_Finalize”中:
ObjectVar.c:135:19:警告:有符号和无符号整数表达式之间的比较[-Wsign compare]
对于(i=0;iallocateElements;i++){
^
在Cursor.c:246:0中包含的文件中,
从连接c:761,
来自SessionPool.c:138,
从cx_Oracle.c:203:
Variable.c:在函数“Variable\u NewByOutputTypeHandler”中:
Variable.c:926:32:警告:有符号和无符号整数表达式之间的比较[-Wsign compare]
if(var->allocateElementsfetchArraySize){
^
在Connection.c:764:0中包含的文件中,
来自SessionPool.c:138,
从cx_Oracle.c:203:
Subscription.c:在函数“MessageTable_Initialize”中:
Subscription.c:451:19:警告:有符号和无符号整数表达式之间的比较[-Wsign compare]
对于(i=0;i
重要的一点似乎是(翻译错误):

cx_Oracle.c:595:1:内部编译器错误:指令非法
}
^
请提交完整的bug报告,
如果合适,使用预处理源。
有关说明,请参阅。
错误:命令“gcc”失败,退出状态为1

如何解决这个问题?

我的python是3.5,系统是ubuntu,oracle是11.2.0.4 instant clienti可以在我的ubuntuLooks上成功使用sqlplus,就像你的gcc安装而不是cx_oracle有问题一样;检查你是否有当前版本的gcc以及相关的工具和库。我在新安装的Fedora.M时遇到了类似的错误请确保您安装了devel工具。不确定它是否与ubuntu的名称相同,但在Fedora上我安装了dnf python devel python3 devel libevent develalex poole是正确的,我重新安装了gcc,现在它可以运行了
  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