I was working on a tutorial of how to build a rest api with python, using uvicorn. When i installed “pyrebase” and tried runing uvicorn, it reported problems importing the module “deque” from “collections”. I tried changing some variable names (in the document there were comments about changes asi “_colections_abc” instead of “colecions.abc” and so. Yes, big mistake… Still didnt solve anything.
Now when i try to use apt or apt-get to install, remove, purge or anything, i get a long response along like :
Error in sys.excepthook:
Traceback (most recent call last):
File "/usr/lib/python3/dist-packages/apport_python_hook.py", line 72, in apport_excepthook
from apport.fileutils import likely_packaged, get_recent_crashes
File "/usr/lib/python3/dist-packages/apport/__init__.py", line 5, in <module>
from apport.report import Report
File "/usr/lib/python3/dist-packages/apport/report.py", line 21, in <module>
from urllib.request import urlopen
File "/usr/lib/python3.10/urllib/request.py", line 88, in <module>
import http.client
File "/usr/lib/python3.10/http/client.py", line 71, in <module>
import email.parser
File "/usr/lib/python3.10/email/parser.py", line 12, in <module>
from email.feedparser import FeedParser, BytesFeedParser
File "/usr/lib/python3.10/email/feedparser.py", line 28, in <module>
from collections import deque
ImportError: cannot import name 'deque' from 'collections' (/usr/lib/python3.10/collections/__init__.py)
Ive tried many options, but most involve using apt or apt-get which i cant… Any suggestions?