问题描述
我从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 (将#修改为@)