转载自: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. Lua和C++交互 学习记录之二:栈操作

    主要内容转载自:子龙山人博客(强烈建议去子龙山人博客完全学习一遍) 部分内容查阅自:<Lua 5.3  参考手册>中文版 译者 云风 制作 Kavcc vs2013+lua-5.3.3 1 ...

  2. traceback模块——获取详细的异常信息

    try: 1/0 except Exception,e: print e 输出结果是integer division or modulo by zero,只知道是报了这个错,但是却不知道在哪个文件哪个 ...

  3. 通过 rufus 创建启动U盘,安装 VMWare Esxi

    现在谁还用光盘安装系统啊. 做出启动盘后,U盘启动进行安装才是王道. https://www.starwindsoftware.com/blog/create-an-esxi-6-5-installa ...

  4. joomla 的语言翻译

    最近装了留言板组件 phocaguestbook,发觉没有中文翻译. 于是在 components\com_phocaguestbook\language\en-GB 找到了英文的文件. 依葫芦画瓢, ...

  5. group by 显示

    public static void PrintPersons()         {             //准备数据             DataTable dt = new DataTa ...

  6. Lab 1-4

    Analyze the file Lab01-04.exe. Questions and Short Answers Upload the Lab01-04.exe file to http://ww ...

  7. 20170928xlVBA自定义分类汇总

    SubtotalByCQL Range("A1:E100").Value, "Select 1,2,Sum(4),Count(4) GroupBy 1,2", ...

  8. C#方式操作Cookie

    1.设置cookie public static void SetCookie(string TokenValue) { HttpCookie tokencookie = new HttpCookie ...

  9. Confluence 6 修改一个空间从归档到当前

    通过空间目录: 进入头部的 空间(Spaces ) > 空间目录(Space directory). 在左侧 选择 归档的空间(Archived Spaces). 找到你的空间,然后单击右侧的  ...

  10. TP5中即点即改,json分页,单删

    HTML页面: <!doctype html><html lang="en"><head> <meta charset="UTF ...