AttributeError: 'cx_Oracle.Cursor' object has no attribute 'numbersAsStrings'
转载自: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'的更多相关文章
- AttributeError: '_csv.reader' object has no attribute 'next'
我在使用pyhon3.4运行以下代码时报错:AttributeError: '_csv.reader' object has no attribute 'next' import csv import ...
- 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 ...
- keras报错:AttributeError: '_thread._local' object has no attribute 'value'
需求是使用pyqt5中的槽函数运行keras模型训练,为了不让工具在模型训练的过程中出现假死的现象,于是把训练操作放到单独的线程中运行,于是问题来了,训练操作在主线程运行时正常,但是界面假死,假若训练 ...
- Django2.2报错 AttributeError: 'str' object has no attribute 'decode'
准备将 Django 连接到 MySQL,在命令行输入命令 python manage.py makemigrations 后报错: AttributeError: 'str' object has ...
- Python脚本报错AttributeError: ‘module’ object has no attribute’xxx’解决方法
最近在编写Python脚本过程中遇到一个问题比较奇怪:Python脚本完全正常没问题,但执行总报错"AttributeError: 'module' object has no attrib ...
- AttributeError: 'list' object has no attribute 'write_pdf'
我在可视化决策树,运行以下代码时报错:AttributeError: 'list' object has no attribute 'write_pdf' 我使用的是python3.4 from sk ...
- attributeError:'module' object has no attribute ** 解决办法
写了一个小脚本,执行的时候报错: Traceback (most recent call last): File "F:/test/qrcode.py", line 109, in ...
- AttributeError: 'module' object has no attribute 'TornadoAsyncNotifier'
/*************************************************************************** * AttributeError: 'modu ...
- AttributeError: 'dict_values' object has no attribute 'translate'
/***************************************************************************************** * Attribu ...
随机推荐
- centos 下卸载mysql
查看当前已安装服务 [root@localhost]# rpm -qa|grep -i mysqlMySQL-server-5.6.36-1.rhel5.x86_64qt-mysql-4.8.5-13 ...
- Inotify&Sersync文件监视工具配置
一.Inotify介绍:一共安装2个工具(命令),即inotifywait和inotifywatchinotifywait:在被监控的文件或目录上等待特定文件系统事件(open.close.delet ...
- 利用Xml架构生成实体访问类
由xml生成xsd及实体类 xmldataset工具 使用VS2005工具XSD.exe(SDK/v2.0/Bin/xsd.exe)自动生成实体类: xsd /c /namespace:myCom ...
- 手动脱UPX压缩壳
示例程序演示 样例程序选择win7自带的notepad.exe,该程序原本是没有加壳的: 拷贝notepad.exe文件一个副本,重命名为notepad - upx.exe,我们对notepad - ...
- 「SDOI2008」Sandy 的卡片
用第一个串建立后缀自动机.然后别的串在上面跑.从根节点开始.如果当前不能转移,一直移到slink或者根.如果移到根,能匹配长度变为0,否则变为maxlen[能转移的点]+1,再转移.转移完往slink ...
- python记录_day07
一.基本数据类型补充 1.列表的拼接用join()方法 li = ["hello","world"] s = "_".join(li) pr ...
- 『计算机视觉』FPN:feature pyramid networks for object detection
对用卷积神经网络进行目标检测方法的一种改进,通过提取多尺度的特征信息进行融合,进而提高目标检测的精度,特别是在小物体检测上的精度.FPN是ResNet或DenseNet等通用特征提取网络的附加组件,可 ...
- css单位分析、颜色设置与调色板
CSS单位分析 px:单位代表像素,1px代表一个像素点. %:设置子元素为父容器的占比. em:代表该元素中一个字体所占字符,常用在文字首行缩进.其具有继承性. rem:始终代表html中的字符所在 ...
- 前端VUE框架-es6
EMCAScript 6 又叫 es2015 1.常量和变量 常量: const a = "hello" 常量不能修改和重复定义 变量: let:定义一个块级作用域的变量 需要先定 ...
- Java中获得当前静态类的类名
通常在打印日志的时候需要输出类名,普通类可以用this.getClass(),但是静态类没有this,直接写类名耦合度高. 参考了: https://stackoverflow.com/questio ...