报错信息:

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的更多相关文章

  1. 运行python脚本报错:selenium.common.exceptions.SessionNotCreatedException: Message: session not created

    运行python脚本报错:selenium.common.exceptions.SessionNotCreatedException: Message: session not created 原因: ...

  2. 头疼的Python 脚本报错

    Python 脚本报错 检查是否用了制表符.变量声明前面不能用制表符,只能用空格,版本为2.7.14

  3. 运行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: ...

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

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

  5. Windows下运行python脚本报错“ImportError: No Module named ...”的解决方法

    之前遇到一个问题,在Pycharm或IPython之类的IDE上运行脚本正常,但是直接运行或cmd命令行运行的时候报了模块未能找到的错误--ImportError: No Module named . ...

  6. Python脚本报错AttributeError: 'module' object has no attribute 'maketrans'

    出现此错误的原因:是此文件smtp02.py 所在的目录下有string.pyc 的文件存在,与python库里的string.pyc冲突造成无法确认编译所取的类库.

  7. shell脚本报错:"[: =: unary operator expected"

    shell脚本报错:"[: =: unary operator expected" 在匹配字符串相等时,我用了类似这样的语句: if [ $STATUS == "OK&q ...

  8. 解决执行sql脚本报错:没有足够的内存继续执行程序。

    出现执行sql脚本报错:没有足够的内存继续执行程序.是因为sql脚本过大,大家可能分为多个文件多次执行,这种笨方法可行,不过比较麻烦,大家可以用下面的方式,利用sqlcmd一次就行了:   执行cmd ...

  9. windows 2012执行powershell脚本报错

    使用powershell运行脚本报错:进行数字签名.无法在当前系统上运行该脚本.有关运行脚本和设置执行策略的详细信息 修复方法:powershell "Set-ExecutionPolicy ...

  10. shell脚本报错:-bash: xxx: /bin/bash^M: bad interpreter: No such file or directory

    当我们把文件从windows系统中编辑的文件拷贝到linux系统中,如果我们执行文件会保存如下的错: shell脚本报错:-bash: xxx: /bin/bash^M: bad interprete ...

随机推荐

  1. 【人脸识别】OpenCV获取自己的图像

    思路:先获取10000张自己的图像,然后通过CNN神经网络进行学习. 第一步:先获取自己的脸的数据.如何做? 代码如下: import cv2 import os import sys import ...

  2. docker 安装 kafka+zookeeper,golang操作kafka

    目录 docker-compose.yml go操作kafka producer 消费者 consumer 消费者 结合gin框架操作kafka go-queue操作kafka 环境: centos8 ...

  3. link标签的media属性

    media属性表示被链接的文档将显示在什么设备上.比如下面的例子: <head> <link rel="stylesheet" type="text/c ...

  4. 支持4k的远程桌面软件有哪些

    在当今的数字时代,在全球向灵活工作安排和分布式团队转变的推动下,对远程工作解决方案的需求猛增.远程桌面软件已成为寻求让员工能够在任何地方工作的企业的重要工具.在用户在此类软件中寻求的众多功能中,对 4 ...

  5. Navigator.sendBeacon()

    navigator.sendBeacon() 方法可用于通过 HTTP POST 将少量数据异步传输到 Web 服务器. 这个方法主要用于满足统计和诊断代码的需要,这些代码通常尝试在卸载(unload ...

  6. Mysql 存储引擎的区别以及索引查询失效的情况

    存储引擎:就是指表在计算机上的存储方式.可以通过 SHOW ENGINES; 命令查询支持的存储引擎. alter table test engine= innodb/memory/myisam/ar ...

  7. C# Socket 封包 拆包 ProtoBuf 的使用

    //这是消息头包,消息头包大小是固定的, //每次传输都要先传消息头,在传消息体 enum EnumMsgType:消息类型 long PackgeSize:包大小 long TotalPackage ...

  8. objectarx 之让用户自定义插件命令

    #include <iostream> #include <fstream> virtual AcRx::AppRetCode On_kInitAppMsg (void *pk ...

  9. Nginx 修饰符 Location 详解

    概述 location 指令可以用在虚拟服务器 server 部分,并且意味着提供来自客户端的 URI 或者内部重定向访问. location 的定义如下: location [modifier] u ...

  10. FFmpeg中的常见结构体

    代码基于FFmpeg5.0.1 目录 FFFormatContext AVFormatContext AVIOContext FFIOContext URLContext URLProtocol AV ...