0

I tried to install cx_Oracle through pip by issuing command pip install cx_Oracle but I am getting this error :

Collecting cx_Oracle
  Downloading cx_Oracle-5.2.1.tar.gz (113kB)
    100% |████████████████████████████████| 122kB 141kB/s 
Building wheels for collected packages: cx-Oracle
  Running setup.py bdist_wheel for cx-Oracle ... error
  Complete output from command /home/srseven/Documents/test/bin/python3.4 -u -c "import setuptools, tokenize;__file__='/tmp/pip-build-yrq51gn9/cx-Oracle/setup.py';f=getattr(tokenize, 'open', open)(__file__);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, __file__, 'exec'))" bdist_wheel -d /tmp/tmpfd_b54rwpip-wheel- --python-tag cp34:
  running bdist_wheel
  running build
  running build_ext
  building 'cx_Oracle' extension
  creating build
  creating build/temp.linux-x86_64-3.4-11g
  x86_64-linux-gnu-gcc -pthread -DNDEBUG -g -fwrapv -O2 -Wall -Wstrict-prototypes -g -fstack-protector --param=ssp-buffer-size=4 -Wformat -Werror=format-security -D_FORTIFY_SOURCE=2 -fPIC -I/u01/app/oracle/product/11.2.0/xe/rdbms/demo -I/u01/app/oracle/product/11.2.0/xe/rdbms/public -I/usr/include/python3.4m -I/home/srseven/Documents/test/include/python3.4m -c cx_Oracle.c -o build/temp.linux-x86_64-3.4-11g/cx_Oracle.o -DBUILD_VERSION=5.2.1
  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

  ----------------------------------------
  Failed building wheel for cx-Oracle
  Running setup.py clean for cx-Oracle
Failed to build cx-Oracle
Installing collected packages: cx-Oracle
  Running setup.py install for cx-Oracle ... error
    Complete output from command /home/srseven/Documents/test/bin/python3.4 -u -c "import setuptools, tokenize;__file__='/tmp/pip-build-yrq51gn9/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-k79o78ca-record/install-record.txt --single-version-externally-managed --compile --install-headers /home/srseven/Documents/test/include/site/python3.4/cx-Oracle:
    running install
    running build
    running build_ext
    building 'cx_Oracle' extension
    creating build
    creating build/temp.linux-x86_64-3.4-11g
    x86_64-linux-gnu-gcc -pthread -DNDEBUG -g -fwrapv -O2 -Wall -Wstrict-prototypes -g -fstack-protector --param=ssp-buffer-size=4 -Wformat -Werror=format-security -D_FORTIFY_SOURCE=2 -fPIC -I/u01/app/oracle/product/11.2.0/xe/rdbms/demo -I/u01/app/oracle/product/11.2.0/xe/rdbms/public -I/usr/include/python3.4m -I/home/srseven/Documents/test/include/python3.4m -c cx_Oracle.c -o build/temp.linux-x86_64-3.4-11g/cx_Oracle.o -DBUILD_VERSION=5.2.1
    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

    ----------------------------------------
Command "/home/srseven/Documents/test/bin/python3.4 -u -c "import setuptools, tokenize;__file__='/tmp/pip-build-yrq51gn9/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-k79o78ca-record/install-record.txt --single-version-externally-managed --compile --install-headers /home/srseven/Documents/test/include/site/python3.4/cx-Oracle" failed with error code 1 in /tmp/pip-build-yrq51gn9/cx-Oracle/

how to resolve this?

1 Answer 1

1

You need to have the Python development package installed on your computer. This is usually called python3-devel but it may be different depending on your platform.

Sign up to request clarification or add additional context in comments.

1 Comment

actually, it was python3-dev for my system which is Ubuntu 14.04.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.