'cx_Oracle.Cursor'对象在Django上没有属性'numbersAsStrings'

时间:2018-09-19 09:43:46

标签: django oracle macos python-2.7

我正在努力解决标题错误,

由于与Django_1.9.X不兼容,我需要安装cx_Oracle <6

我已经尝试了在google中找到的所有内容;设置环境变量,重新安装InstantClient,我不知道该怎么办。

  Running setup.py install for cx-Oracle ... error
    Complete output from command /Users/mmariscal/sourcetree/save_the_cau/venv1/bin/python -u -c "import setuptools, tokenize;__file__='/private/var/folders/w4/p5qt5g3143n99zm3gy_z79rh0000gp/T/pip-install-2JYYyQ/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 /private/var/folders/w4/p5qt5g3143n99zm3gy_z79rh0000gp/T/pip-record-JvIl3W/install-record.txt --single-version-externally-managed --compile --install-headers /Users/mmariscal/sourcetree/save_the_cau/venv1/include/site/python2.7/cx-Oracle:
    running install
    running build
    running build_ext
    building 'cx_Oracle' extension
    creating build
    creating build/temp.macosx-10.13-intel-2.7-12c
    creating build/temp.macosx-10.13-intel-2.7-12c/src
    cc -fno-strict-aliasing -fno-common -dynamic -arch x86_64 -arch i386 -g -Os -pipe -fno-common -fno-strict-aliasing -fwrapv -DENABLE_DTRACE -DMACOSX -DNDEBUG -Wall -Wstrict-prototypes -Wshorten-64-to-32 -DNDEBUG -g -fwrapv -Os -Wall -Wstrict-prototypes -DENABLE_DTRACE -arch i386 -arch x86_64 -pipe -I/opt/instantclient_12_2 -I/System/Library/Frameworks/Python.framework/Versions/2.7/include/python2.7 -c src/cx_Oracle.c -o build/temp.macosx-10.13-intel-2.7-12c/src/cx_Oracle.o -DBUILD_VERSION=5.3
    src/cx_Oracle.c:21:10: fatal error: 'oci.h' file not found
    #include <oci.h>
             ^~~~~~~
    1 error generated.
    error: command 'cc' failed with exit status 1

    ----------------------------------------
  Rolling back uninstall of cx-Oracle
Command "/Users/mmariscal/sourcetree/save_the_cau/venv1/bin/python -u -c "import setuptools, tokenize;__file__='/private/var/folders/w4/p5qt5g3143n99zm3gy_z79rh0000gp/T/pip-install-2JYYyQ/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 /private/var/folders/w4/p5qt5g3143n99zm3gy_z79rh0000gp/T/pip-record-JvIl3W/install-record.txt --single-version-externally-managed --compile --install-headers /Users/mmariscal/sourcetree/save_the_cau/venv1/include/site/python2.7/cx-Oracle" failed with error code 1 in /private/var/folders/w4/p5qt5g3143n99zm3gy_z79rh0000gp/T/pip-install-2JYYyQ/cx-Oracle/

谢谢

1 个答案:

答案 0 :(得分:1)

您需要安装这两项:

https://www.oracle.com/technetwork/database/database-technologies/instant-client/downloads/index.html

instantclient-basic-XXX.zip
instantclient-sdk-XXX.zip

仅基本是不够的。