如何修复 'google.cloud.vision' 在 python3 中没有属性 'Client'?

How to fix 'google.cloud.vision' has no attribute 'Client' in python3?

我是运行一个利用google云视觉api的简单代码,但它一直在抛出这个错误。我已尝试升级此处显示的软件包: 但错误仍然存​​在。

PS:正在使用虚拟环境(virtualenv)

Client() class 是 removed in the Client Library v0.25.1 and replaced with ImageAnnotatorClient()

您可以将 Client 替换为 ImageAnnotatorClient,或者通过在 requirements.txt

中指定来使用 v0.25.1 之前的客户端库版本