Note: dnspython is now a dependency of pymongo 4.3+ and will be automatically installed when installing those versions of pymongo.
When a user attempts to use a mongodb+srv:// connection string when dnspython is not installed we raise this error:
>>> client = pymongo.MongoClient( ... "mongodb+srv://<username>:<password>@<cluster-url>/test?retryWrites=true&w=majority") Traceback (most recent call last): File "<stdin>", line 1, in <module> File "/Users/shane/.venv/lib/python3.9/site-packages/pymongo/mongo_client.py", line 639, in __init__ res = uri_parser.parse_uri( File "/Users/shane/.venv/lib/python3.9/site-packages/pymongo/uri_parser.py", line 428, in parse_uri raise ConfigurationError('The "dnspython" module must be ' pymongo.errors.ConfigurationError: The "dnspython" module must be installed to use mongodb+srv:// URIs
We should generate the command they need to run so they can copy/paste it, like this:
pymongo.errors.ConfigurationError: The "dnspython" module must be installed to use mongodb+srv:// URIs. To fix this error install pymongo with the srv extra: /Users/shane/git/mongo-python-driver/.venv/bin/python -m pip install 'pymongo[srv]'
- is related to
-
PYTHON-2640 Replace dnspython with our own SRV dns implementation
- Development Complete
-
MOTOR-706 Include tornado and dnspython as install_Requires
- Closed
-
PYTHON-2643 requirements.txt
- Closed
- mentioned in
-
Page Loading...