首页
学习
活动
专区
圈层
工具
发布
首页
学习
活动
专区
圈层
工具
MCP广场
社区首页 >问答首页 >使用pip安装cx_Oracle时出现问题

使用pip安装cx_Oracle时出现问题
EN

Stack Overflow用户
提问于 2017-04-05 03:16:16
回答 1查看 2.2K关注 0票数 1

我正在尝试使用pip安装cx_Oracle,但我在控制台中不断得到此输出。

代码语言:javascript
运行
复制
(test_env1)[ django@hostname ~ ] $ pip install cx_Oracle
Collecting cx_Oracle
  Using cached cx_Oracle-5.3.tar.gz
Installing collected packages: cx-Oracle
  Running setup.py install for cx-Oracle ... error
    Complete output from command /opt/svcacct/django/test_env1/bin/python -u -c "import setuptools, tokenize;__file__='/tmp/pip-build-4525wz/cx-Oracle/setup.py';f=getattr(tokenize, 'open', open)(__file__);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, __file__, 'exec'))" install --record /tmp/pip-BoJI2V-record/install-record.txt --single-version-externally-managed --compile --install-headers /opt/svcacct/django/test_env1/include/site/python2.7/cx-Oracle:
    running install
    running build
    running build_ext
    building 'cx_Oracle' extension
    creating build
    creating build/temp.linux-x86_64-2.7-11g
    creating build/temp.linux-x86_64-2.7-11g/src
    gcc -pthread -fno-strict-aliasing -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector-strong --param=ssp-buffer-size=4 -grecord-gcc-switches -m64 -mtune=generic -D_GNU_SOURCE -fPIC -fwrapv -DNDEBUG -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector-strong --param=ssp-buffer-size=4 -grecord-gcc-switches -m64 -mtune=generic -D_GNU_SOURCE -fPIC -fwrapv -fPIC -I/app/oracle/instantclient_11_1/sdk/include -I/usr/include/python2.7 -c src/cx_Oracle.c -o build/temp.linux-x86_64-2.7-11g/src/cx_Oracle.o -DBUILD_VERSION=5.3
    src/cx_Oracle.c:28:2: error: #error Oracle 11.2 or later client libraries are required for building
     #error Oracle 11.2 or later client libraries are required for building
      ^
    error: command 'gcc' failed with exit status 1

    ----------------------------------------
Command "/opt/svcacct/django/test_env1/bin/python -u -c "import setuptools, tokenize;__file__='/tmp/pip-build-4525wz/cx-Oracle/setup.py';f=getattr(tokenize, 'open', open)(__file__);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, __file__, 'exec'))" install --record /tmp/pip-BoJI2V-record/install-record.txt --single-version-externally-managed --compile --install-headers /opt/svcacct/django/test_env1/include/site/python2.7/cx-Oracle" failed with error code 1 in /tmp/pip-build-4525wz/cx-Oracle/

我在环境变量中安装了oracle。

EN

回答 1

Stack Overflow用户

发布于 2017-04-05 07:13:51

您需要确保您的计算机上已安装Oracle客户端。最简单的是Oracle Instant Client,您可以从以下位置获得:

http://www.oracle.com/technetwork/topics/linuxx86-64soft-092277.html

按照页面底部的说明进行操作。确保您已经安装了"Basic“或"Basic Light”包以及"SDK“包。只有构建cx_Oracle时才需要SDK包。

票数 2
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/43215811

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档