如何解决“Python 问题:无法解析兼容的发行版”

问题描述 投票:0回答:1

在 Jupyter Notebook 中运行 Python 代码时,我遇到以下问题:

Exception message: 1 Exception encountered:
 
ProcessExecutionFailure: Process 'Building requirements.pex…'

stderr:
Failed to resolve compatible distributions:
1: grpcio-status==1.62.0 requires protobuf>=4.21.6 but protobuf 3.20.3 was resolved

我没有使用Python的经验,但我相信这可能与使用google-cloud-vision 2.3.1有关。有关更多信息,请在 lambda 文件中找到 grpcio 1.39.0(不是 grpcio-status)和 protobuf 3.17.3(从上次工作时开始)。

有人有解决办法吗?

以前,我尝试在 BUILD 文件和根目录中的requirements.txt 文件(通常不存在)中指定依赖项版本。没有任何变化。

python python-3.x google-cloud-vision pants
1个回答
0
投票

grpcio-status 似乎需要 protobuf 版本 4.21.6 或更高版本。可以尝试使用类似于 grpcio-status==4.21.6 的写法来指定版本。

© www.soinside.com 2019 - 2024. All rights reserved.