from pymongo import MongoClient
client = MongoClient('mongodb+srv://test:sparta@cluster0.hxcfk.mongodb.net/?retryWrites=true&w=majority')
db = client.dbsparta
-몽고를 파이참에 연결하는데
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/Users/ohinwoo/Desktop/sparta/pythonprac/dbprac.py", line 3, in <module>
client = MongoClient('mongodb+srv://test:sparta@cluster0.hxcfk.mongodb.net/?retryWrites=true&w=majority')
File "/Users/ohinwoo/Desktop/sparta/pythonprac/venv/lib/python3.8/site-packages/pymongo/mongo_client.py", line 726, in __init__
res = uri_parser.parse_uri(
File "/Users/ohinwoo/Desktop/sparta/pythonprac/venv/lib/python3.8/site-packages/pymongo/uri_parser.py", line 542, in parse_uri
nodes = dns_resolver.get_hosts()
File "/Users/ohinwoo/Desktop/sparta/pythonprac/venv/lib/python3.8/site-packages/pymongo/srv_resolver.py", line 121, in get_hosts
_, nodes = self._get_srv_response_and_hosts(True)
File "/Users/ohinwoo/Desktop/sparta/pythonprac/venv/lib/python3.8/site-packages/pymongo/srv_resolver.py", line 101, in _get_srv_response_and_hosts
results = self._resolve_uri(encapsulate_errors)
File "/Users/ohinwoo/Desktop/sparta/pythonprac/venv/lib/python3.8/site-packages/pymongo/srv_resolver.py", line 97, in _resolve_uri
raise ConfigurationError(str(exc))
pymongo.errors.ConfigurationError: The DNS response does not contain an answer to the question: _mongodb._tcp.cluster0.hxcfk.mongodb.net. IN SRV
이 에러가 발생하여 다음 진도를 넘어가지 못하고 있습니다 빠른 답변 해주시면 감사하겠습니다.