【问题标题】:'cx_Oracle.Cursor' object has no attribute 'numbersAsStrings' on Django'cx_Oracle.Cursor' 对象在 Django 上没有属性 'numbersAsStrings'
【发布时间】:2019-02-23 10:51:36
【问题描述】:

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

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

我已经尝试了我在 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/

谢谢

【问题讨论】:

    标签: django oracle macos python-2.7


    【解决方案1】:

    你需要安装这两个:

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

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

    只有基本是不够的。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2020-02-11
      • 2015-02-19
      • 2016-03-30
      • 2021-04-05
      • 2013-05-23
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多