2015-03-13 78 views
2

➜cx_oracle蟒蛇cx_oracle的setup.py的方式建立如何安裝上unbuntu14.04

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 

,我換python2.7通過Anaconda.it似乎是蟒蛇裝錯。

回答

4

您需要安裝python-dev包,以便蟒蛇頭可供選擇:

sudo apt-get install python-dev 
+1

安裝後python3-DEV我的問題解決了,所以也許你正在使用Python 3 – latsha 2016-04-28 11:10:03