search
LoginSignup
0

posted at

Pymongo4.0以降で[Errno 11001] getaddrinfo failed.になる問題

参考:
https://pymongo.readthedocs.io/en/stable/migrate-to-pymongo4.html
https://pymongo.readthedocs.io/en/stable/changelog.html

1.pythonとmongoDBのバージョンを確認する。

Warning PyMongo 4.0 drops support for Python 2.7, 3.4, and 3.5.
Warning PyMongo 4.0 drops support for MongoDB 2.6, 3.0, 3.2, and 3.4.

2.uriが正しく記述できているか確認する。

uri = "xxx"
client = pymongo.MongoClient(uri)

3.directConnection = True を引数で渡しているか確認する。

uri = "xxx"
client = pymongo.MongoClient(uri, directConnection=True)

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
What you can do with signing up
0