close

[Solved] pymongo – “dnspython” module must be installed to use mongodb+srv:// URIs

Hello Guys, How are you all? Hope You all Are Fine. Today I get the following error pymongo – “dnspython” module must be installed to use mongodb+srv:// URIs in python. So Here I am Explain to you all the possible solutions here.

Without wasting your time, Let’s start This Article to Solve This Error.

How pymongo – “dnspython” module must be installed to use mongodb+srv:// URIs Error Occurs?

Today I get the following error pymongo – “dnspython” module must be installed to use mongodb+srv:// URIs in python.

How To Solve pymongo – “dnspython” module must be installed to use mongodb+srv:// URIs Error ?

  1. How To Solve pymongo – “dnspython” module must be installed to use mongodb+srv:// URIs Error ?

    To Solve pymongo – “dnspython” module must be installed to use mongodb+srv:// URIs Error I would like to answer my own questions here. As I mentioned in the comment, the kernel of the jupyter notebook has to be restarted in order for the pymongo to take effect of the loaded dnspython.

  2. pymongo – “dnspython” module must be installed to use mongodb+srv:// URIs

    To Solve pymongo – “dnspython” module must be installed to use mongodb+srv:// URIs Error I would like to answer my own questions here. As I mentioned in the comment, the kernel of the jupyter notebook has to be restarted in order for the pymongo to take effect of the loaded dnspython.

Solution 1

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]'

Solution 2

I would like to answer my own questions here. As I mentioned in the comment, the kernel of the jupyter notebook has to be restarted in order for the pymongo to take effect of the loaded dnspython.

Summery

It’s all About this issue. Hope all solution helped you a lot. Comment below Your thoughts and your queries. Also, Comment below which solution worked for you? Thank You.

Also, Read