gpt4 book ai didi

python - 属性错误 : 'WriteConcern' object has no attribute 'acknowledged'

转载 作者:可可西里 更新时间:2023-11-01 09:43:17 26 4
gpt4 key购买 nike

我已经在 MongoDB 数据库中存储了一个 pdf,我正在按如下方式访问它:

dbPDFReports = client['pdfReports']

客户端是我的 MongoClient 如下:

client = MongoClient(some_ip, 27017)

但是我收到了这个错误:

AttributeError: 'WriteConcern' object has no attribute 'acknowledged'

知道为什么吗?

编辑

升级 pymongo 后,我得到了以下回溯:

Traceback (most recent call last):
File "main.py", line 2, in <module>
from bulk import *
File "/home/inno/InnovAccer/Projects/tiger-global-backend/API/bulk.py", line 1, in <module>
from pymongo import MongoClient
File "/home/inno/InnovAccer/Projects/tiger-global-backend/API/pymongo/__init__.py", line 83, in <module>
from pymongo.collection import ReturnDocument
File "/home/inno/InnovAccer/Projects/tiger-global-backend/API/pymongo/collection.py", line 22, in <module>
from bson.py3compat import (_unicode,
ImportError: cannot import name _unicode

最佳答案

升级 pymongocurrently latest (3.0.3) version :

pip install --upgrade pymongo

关于python - 属性错误 : 'WriteConcern' object has no attribute 'acknowledged' ,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/31812832/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com