转载自:https://www.wengbi.com/thread_77579_1.html

最近在本地搭建Django开发环境,Django 1.11,python 2.7.11,数据库Oracle 11g,cx_Oracle 6.2 的时候,出现以上问题。
简单的搜索了一下,发现错误原因是cx_Oracle在6.0版本就移除了cx_Oracle.Cursor对象的numbersAsStrings属性。
于是又在度娘上查,结果除了一个降低cx_Oracle版本至5.2的比较靠谱(也是一种解决办法),其他的都是复制粘贴,或者cx_Oracle的版本更新说明文档。
闲话说完,最后在google上查询到了解决办法,如下:
①找到python安装路径下的oracle的包,一般windows的默认路径为C:\Python27\Lib\site-packages\django\db\backends\oracle,mac或linux自行搜索,这里就不赘述了。然后修改base.py文件。
②找到类FormatStylePlaceholderCursor,修改成如下图所示

<ignore_js_op>

AttributeError: 'cx_Oracle.Cursor' object has no attribute 'numbersAsStrings'的更多相关文章

  1. AttributeError: '_csv.reader' object has no attribute 'next'

    我在使用pyhon3.4运行以下代码时报错:AttributeError: '_csv.reader' object has no attribute 'next' import csv import ...

  2. AttributeError: 'sys.flags' object has no attribute 'utf8_mode'

    AttributeError: 'sys.flags' object has no attribute 'utf8_mode' pycharm工程的py版本是3.6,结果即使使用py3.7编译后的py ...

  3. keras报错:AttributeError: '_thread._local' object has no attribute 'value'

    需求是使用pyqt5中的槽函数运行keras模型训练,为了不让工具在模型训练的过程中出现假死的现象,于是把训练操作放到单独的线程中运行,于是问题来了,训练操作在主线程运行时正常,但是界面假死,假若训练 ...

  4. Django2.2报错 AttributeError: 'str' object has no attribute 'decode'

    准备将 Django 连接到 MySQL,在命令行输入命令 python manage.py makemigrations 后报错: AttributeError: 'str' object has ...

  5. Python脚本报错AttributeError: ‘module’ object has no attribute’xxx’解决方法

    最近在编写Python脚本过程中遇到一个问题比较奇怪:Python脚本完全正常没问题,但执行总报错"AttributeError: 'module' object has no attrib ...

  6. AttributeError: 'list' object has no attribute 'write_pdf'

    我在可视化决策树,运行以下代码时报错:AttributeError: 'list' object has no attribute 'write_pdf' 我使用的是python3.4 from sk ...

  7. attributeError:'module' object has no attribute ** 解决办法

    写了一个小脚本,执行的时候报错: Traceback (most recent call last): File "F:/test/qrcode.py", line 109, in ...

  8. AttributeError: 'module' object has no attribute 'TornadoAsyncNotifier'

    /*************************************************************************** * AttributeError: 'modu ...

  9. AttributeError: 'dict_values' object has no attribute 'translate'

    /***************************************************************************************** * Attribu ...

随机推荐

  1. c# 7.0 学习笔记

    refer : https://docs.microsoft.com/en-us/dotnet/csharp/whats-new/csharp-7 out 可以写在里面了 // int result ...

  2. word空白页怎么删除

    最简单的,直接按键盘上的BackSpace或者Delete键,来进行删除.  分页符过到.打开“编辑”-->替换-->高级-->特殊字符-->手工分页符-->“全部替换” ...

  3. spring cloud: Hystrix(七):Hystrix的断容器监控dashboard

    Hystrix的断容器监控dashboard. dashboard是用来监控Hystrix的断容器监控的,图形化dashboard是如何实现指标的收集展示的. dashboard 本地端口8730 项 ...

  4. Node.js 知识(教程)

    JavaScript on the Server JavaScript was originally built for web browsers, but with Node.js we can u ...

  5. 部署的error和排查,注意服务器内存占用!

    mysqladmin: connect to server at 'localhost' failed error: 'Can't connect to local MySQL server thro ...

  6. SWUST OJ (943)

    顺序表插入操作的实现 #include<stdio.h> #include <stdlib.h> void InitList(int *&l, int n) { l = ...

  7. 笔记react router 4(一)

    用过react router4.X的小伙伴一定知道,比起3.X的版本,router的使用上有了很大的改变. 首先,我们只需要安装 react-router-dom 即可使用.看到“dom”想必你就该知 ...

  8. PAT 1009 Product of Polynomials

    1009 Product of Polynomials (25 分)   This time, you are supposed to find A×B where A and B are two p ...

  9. Leetcode 145

    /** * Definition for a binary tree node. * struct TreeNode { * int val; * TreeNode *left; * TreeNode ...

  10. SVN 多分支管理

    SVN 新建时可以选择性的建立三个文件夹 trunk            一般作为主开发的地方 branches       一般作为从trunk Copy过去的代码,形成分支 tags       ...