Ask coding questions

← Back to all posts
Invalid Syntax on pymongo and dns
meziosaur (0)

Hello, my discord bot was working fine on replit but now I see this error, I can't run it anymore

import pymongo, dns also gives an error

Replit: Updating package configuration

--> python3 -m poetry add dnspython
Using version ^2.1.0 for dnspython

Updating dependencies
Resolving dependencies...



at /opt/virtualenvs/python3/lib/python3.8/site-packages/poetry/utils/ 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
→ 98│ with get(url, stream=True) as response:
99│ response.raise_for_status()
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.

Answered by OldWizard209 (1643) [earned 5 cycles]
View Answer
OldWizard209 (1643)

Try importing them separately:

import pymongo
import dns

if that doesn't work, try installing using pip.

meziosaur (0)

Thank you! That seem to do the trick