heroku 导入错误:无法从"集合"导入名称"容器"

wb1gzix0  于 2023-02-04  发布在  其他
关注(0)|答案(1)|浏览(345)

我的代码在本地运行正常,但是在Heroku上崩溃了。我该怎么做才能修复它?

Traceback (most recent call last)
   File "/app/nao_entre_em_panico.py", line 2, in <module>
     from flask import Flask, jsonify, request
   File "/app/.heroku/python/lib/python3.10/site-packages/flask/__init__.py", line 17, in <module>
     from werkzeug.exceptions import abort
   File "/app/.heroku/python/lib/python3.10/site-packages/werkzeug/__init__.py", line 151, in <module>
     __import__('werkzeug.exceptions')
   File "/app/.heroku/python/lib/python3.10/site-packages/werkzeug/exceptions.py", line 71, in <module>
     from werkzeug.wrappers import Response
   File "/app/.heroku/python/lib/python3.10/site-packages/werkzeug/wrappers.py", line 27, in <module>
     from werkzeug.http import HTTP_STATUS_CODES, \
   File "/app/.heroku/python/lib/python3.10/site-packages/werkzeug/http.py", line 1148, in <module>
     from werkzeug.datastructures import Accept, HeaderSet, ETags, Authorization, \
   File "/app/.heroku/python/lib/python3.10/site-packages/werkzeug/datastructures.py", line 16, in <module>
     from collections import Container, Iterable, MutableSet
 ImportError: cannot import name 'Container' from 'collections' (/app/.heroku/python/lib/python3.10/collections/__init__.py)
kmpatx3s

kmpatx3s1#

ContainerIterableMutableSet和其他抽象基类在Python 3.3之后的collections.abc中。

相关问题