原文:TypeError: 'Collection' object is not callable. If you meant to call the 'authenticate' method on a 'Database' object it is failing because no such method exists.

这两天给新电脑安装环境后发现之前的代码不能进行mongodb数据库用户认证,报错如标题所示,查看一番后发现是pymongo的版本问题 在pymongo . 版本的时候进行用户认证代码如下: 在pymongo . 及以前是可以正常运行的,能够进行用户认证,当我升级到 . 后报错如下 查看官方文档后发现解释如下: . 文档地址:https: pymongo.readthedocs.io en stab ...

2021-12-01 17:38 0 9814 推荐指数:

查看详情

TypeError系列之:TypeError: 'tuple' object is not callable.

TypeError: 'tuple' object is not callable. 通过翻译““tuple”对象不可调用”,在网上没有一个符合自己错误的解决方案。经过逐个方法的试验总结如下: 出现该问题,依据提示是程序中将非调用的函数进行调用。 1、需要手工检查代码,是否有调用错误的函数 ...

Thu Nov 25 04:03:00 CST 2021 0 2430
错误类型:TypeError: 'method' object is not subscriptable

可能是由于函数括号写错,或者哪里写的不够规范 错误代码如下: title=li.xpath[".//a/@href"]    此时会报错:TypeError: 'method' object is not subscriptable 修改后: title ...

Thu Mar 12 07:36:00 CST 2020 0 4387
TypeError: 'module' object is not callable

目录 问题描述 运行命令 错误日志 解决方法 问题分析 问题描述 运行命令 错误日志 解决方法 安装历史版本 ...

Sat Mar 23 19:48:00 CST 2019 0 2271
TypeError: 'module' object is not callable

TypeError: 'module' object is not callable Person.py object_to_json.py 运行object_to_json.py时报错: Traceback (most recent call last): ​ File "E ...

Thu Dec 31 03:29:00 CST 2020 0 1691
 
粤ICP备18138465号  © 2018-2025 CODEPRJ.COM