python - 如何在unbuntu14.04上安装cx_oracle

标签 python cx-oracle

➜ cx_oracle python setup.py 构建

running build
running build_ext
building 'cx_Oracle' extension
x86_64-linux-gnu-gcc -pthread -fno-strict-aliasing -DNDEBUG -g -fwrapv -O2 -Wall -Wstrict-prototypes -fPIC -I/home/qk/Documents/instantclient_11_2 -I/usr/include/python2.7 -c cx_Oracle.c -o build/temp.linux-x86_64-2.7-11g/cx_Oracle.o -DBUILD_VERSION=5.2
cx_Oracle.c:6:20: fatal error: Python.h: No such file or directory
 #include <Python.h>
                    ^
compilation terminated.
error: command 'x86_64-linux-gnu-gcc' failed with exit status 1
➜  cx_oracle  echo $ORACLE_HOME
/home/qk/Documents/instantclient_11_2
➜  cx_oracle  echo $DYLD_LIBRARY_PATH
/home/qk/Documents/instantclient_11_2
➜  cx_oracle  echo $LD_LIBRARY_PATH
/home/qk/Documents/instantclient_11_2
➜  cx_oracle  python
Python 2.7.6 (default, Mar 22 2014, 22:59:56) 
[GCC 4.8.2] on linux2
Type "help", "copyright", "credits" or "license" for more informat

顺便说一下,我用Anaconda切换了python2.7,看来是python安装错误了。

最佳答案

您需要安装 python-dev 包,以便 python header 可用:

sudo apt-get install python-dev

关于python - 如何在unbuntu14.04上安装cx_oracle,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/29038339/

相关文章:

python - 在 Python pandas 中将 DataFrame 添加到面板

python - 使用 couchdb-python 获取多个 CouchDB 文档

python - python 无法识别 cx_Oracle

python - py2exe/cx_Oracle - 生成的 dist 中的 OCI.dll

python - 在 64 位 linux 机器上运行 32 位 Python 脚本以使用 32 位客户端连接到 oracle DB

python - python和oracle处理异常握手的正确方法

Python + celery : Prevent duplicate task execution

python - 当内部为真时,如何使循环外的事情发生

python - 扭曲的海螺文件传输

python - 将列表传递给 PL/SQL 过程