DeprecationWarning:不建议使用“集合”而不是“ collections.abc”中的ABC或从其中导入ABC,在3.8中它将停止工作

问题描述

我从github下载了一个代码,并试图通过在git bash中运行命令来按原样运行它:python manage.py runserver

但是我遇到此错误

DeprecationWarning: Using or importing the ABCs from 'collections' instead of from 'collections.abc' is deprecated,and in 3.8 it will stop working

已按照此答案How to use collections.abc from both Python 3.8+ and Python 2.7中的建议对我的manage.py文件进行了更改 但仍然面临相同的错误

import os
import sys

try:
    from collections.abc import Callable
except ImportError:
    from collections import Callable

if __name__ == "__main__":
    os.environ.setdefault("DJANGO_SETTINGS_MODULE","app.settings")
    try:
        from django.core.management import execute_from_command_line
    except ImportError as exc:
        raise ImportError(
            "Couldn't import Django. Are you sure it's installed and "
            "available on your PYTHONPATH environment variable? Did you "
            "forget to activate a virtual environment?"
        ) from exc
execute_from_command_line(sys.argv)

解决方法

暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!

如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。

小编邮箱:dio#foxmail.com (将#修改为@)

相关问答

Selenium Web驱动程序和Java。元素在(x,y)点处不可单击。其...
Python-如何使用点“。” 访问字典成员?
Java 字符串是不可变的。到底是什么意思?
Java中的“ final”关键字如何工作?(我仍然可以修改对象。...
“loop:”在Java代码中。这是什么,为什么要编译?
java.lang.ClassNotFoundException:sun.jdbc.odbc.JdbcOdbc...