I am trying to connect MongoDB from Atlas.
My mongo uri is: mongodb+srv://abc:[email protected]/admin?retryWrites=True
My pymongo version is 3.6.1
I have installed dnspython
and done import dns
But i still get this error:
dnspython module must be installed to use mongodb+srv:// URI
In order to use mongo+srv protocol, you need to install pymongo-srv Launch this command to do it with python 3:
pip3 install pymongo[srv]
or this one for other versions:
pip install pymongo[srv]
And as suggested by @lukrebs, add quotes for ZSH:
pip3 install 'pymongo[srv]'
I solved this problem with:
$ python -m pip install pymongo[srv]
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With