Python脚本报错:DeprecationWarning: Using or importing the ABCs from 'collections' instead of from 'collections.abc' is deprecated since Python 3.3,and in 3.9 it will stop working import pymssql
报错信息:
monitor_mssql.py:10: DeprecationWarning: Using or importing the ABCs from 'collections' instead of from 'collections.abc' is deprecated since Python 3.3,and in 3.9 it will stop working
import pymssql
这种 warning 就是快过期的不向后兼容的语法做了个警告。
解决办法
1. 更新 pymssql 这个警告的库, 一般有人维护的话, 作者会因为这 issue 更新版本。
2. 注释掉这个告警模块,一般不建议。
3. 调整导入包的写法。
# from collections import Iterable ---这是会报警告的用法
from collections.abc import Iterable ---这是不会报警告的用法
print(isinstance('abc', Iterable))
4. 直接屏蔽这个提示。在前面加两行代码:import warnings ...
import warnings
warnings.simplefilter('ignore', DeprecationWarning)
import pymssql
Python脚本报错:DeprecationWarning: Using or importing the ABCs from 'collections' instead of from 'collections.abc' is deprecated since Python 3.3,and in 3.9 it will stop working import pymssql的更多相关文章
- 运行python脚本报错:selenium.common.exceptions.SessionNotCreatedException: Message: session not created
运行python脚本报错:selenium.common.exceptions.SessionNotCreatedException: Message: session not created 原因: ...
- 头疼的Python 脚本报错
Python 脚本报错 检查是否用了制表符.变量声明前面不能用制表符,只能用空格,版本为2.7.14
- 运行python脚本报错SyntaxError: (unicode error) 'unicodeescape' codec can't decode bytes in position 2-3: truncated \UXXXXXXXX escape
运行python脚本报错 SyntaxError: (unicode error) 'unicodeescape' codec can't decode bytes in position 2-3: ...
- Python脚本报错AttributeError: ‘module’ object has no attribute’xxx’解决方法
最近在编写Python脚本过程中遇到一个问题比较奇怪:Python脚本完全正常没问题,但执行总报错"AttributeError: 'module' object has no attrib ...
- Windows下运行python脚本报错“ImportError: No Module named ...”的解决方法
之前遇到一个问题,在Pycharm或IPython之类的IDE上运行脚本正常,但是直接运行或cmd命令行运行的时候报了模块未能找到的错误--ImportError: No Module named . ...
- Python脚本报错AttributeError: 'module' object has no attribute 'maketrans'
出现此错误的原因:是此文件smtp02.py 所在的目录下有string.pyc 的文件存在,与python库里的string.pyc冲突造成无法确认编译所取的类库.
- shell脚本报错:"[: =: unary operator expected"
shell脚本报错:"[: =: unary operator expected" 在匹配字符串相等时,我用了类似这样的语句: if [ $STATUS == "OK&q ...
- 解决执行sql脚本报错:没有足够的内存继续执行程序。
出现执行sql脚本报错:没有足够的内存继续执行程序.是因为sql脚本过大,大家可能分为多个文件多次执行,这种笨方法可行,不过比较麻烦,大家可以用下面的方式,利用sqlcmd一次就行了: 执行cmd ...
- windows 2012执行powershell脚本报错
使用powershell运行脚本报错:进行数字签名.无法在当前系统上运行该脚本.有关运行脚本和设置执行策略的详细信息 修复方法:powershell "Set-ExecutionPolicy ...
- shell脚本报错:-bash: xxx: /bin/bash^M: bad interpreter: No such file or directory
当我们把文件从windows系统中编辑的文件拷贝到linux系统中,如果我们执行文件会保存如下的错: shell脚本报错:-bash: xxx: /bin/bash^M: bad interprete ...
随机推荐
- 面对Centos7系统的openssl版本升级
CentOS7的版本系统,默认的OpenSSL的版本为OpenSSL 1.0.2k-fips 26 Jan 2017.但是openssl需要的版本需要较高的版本.通过下载最新的openssl版本.对o ...
- sh角本操作数据库
#!/bin/bash HOST="127.0.0.1" PORT="3306" USERNAME="root" PASSWORD=&quo ...
- golang计时器
timer 计时器 用于在指定的Duration类型时间后调用函数或计算表达式. 如果只是想指定时间之后执行,使用time.Sleep() 使用NewTimer(),可以返回的Timer类型在计时器到 ...
- ansible(2)--ansible的安装与配置文件管理
目录 1 ansible的安装 1.1 yum安装 1.2 pip安装 2 ansible相关文件 2.1 ansible配置文件 2.2 ansible配置文件的优先级 2.3 ansible的主机 ...
- 数据库中存储bool对象的数据,使用Bit和Integer有什么区别,性能上有多大的差异
在数据库中存储布尔(Boolean)值时,常见的两种选择是使用 BIT 类型或 INTEGER 类型.两者在存储.性能和使用上的区别如下: 1. BIT 类型 存储:BIT 类型专门用于存储布尔值.通 ...
- LLM实战:当网页爬虫集成gpt3.5
1. 背景 最近本qiang~关注了一个开源项目Scrapegraph-ai,是关于网页爬虫结合LLM的项目,所以想一探究竟,毕竟当下及未来,LLM终将替代以往的方方面面. 这篇文章主要介绍下该项目, ...
- phpstorm对laravel开发的配置
摘自:https://www.cnblogs.com/Richard-Tang/p/10218178.html phpstorm对laravel开发的配置 一.安装Laravel 1.下载comp ...
- FFmpeg开发笔记(二十三)使用OBS Studio开启RTMP直播推流
OBS是一个开源的直播录制软件,英文全称叫做Open Broadcaster Software,广泛用于视频录制.实时直播等领域.OBS不但开源,而且跨平台,兼容Windows.Mac OS.Lin ...
- k8s——istio
安装istio Istio / 入门 [root@master ~]# curl -L https://istio.io/downloadIstio | sh - % Total % Received ...
- Qt-绘图设备
1 简介 参考视频:https://www.bilibili.com/video/BV1XW411x7NU?p=40 Qt绘图设备有三种:QPixmap.QBitmap.QImage.QPictur ...