Ask coding questions

← Back to all posts
PyMongo import error
meziosaur (0)

Hello! When I try to add PyMongo via Packages or via "import pymongo" I get this error, does anyone know what to do?

--> python3 -m poetry add pymongo
Using version ^3.11.4 for pymongo

Updating dependencies
Resolving dependencies...

AttributeError

enter

at /opt/virtualenvs/python3/lib/python3.8/site-packages/poetry/utils/helpers.py:98 in download_file
94│ url, dest, session=None, chunk_size=1024
95│ ): # type: (str, str, Optional[requests.Session], int) -> None
96│ get = requests.get if not session else session.get
97│
→ 98│ with get(url, stream=True) as response:
99│ response.raise_for_status()
100│
101│ with open(dest, "wb") as f:
102│ for chunk in response.iter_content(chunk_size=chunk_size):
exit status 1

Replit: Package operation failed.

Comments
hotnewtop
InvisibleOne (3224)

Delete your package files, then do pip install pymongo and pip install dns in the shell. They rerun your repl.

VulcanWM (2904)

import pymongo and dns