我使用pip安装了一个包,该包将使用不同版本的需求从多个依赖项中要求protobuf。
pip输出此错误

使用pipdeptree,我可以看到没有任何包需要高于4.0的protobuf版本,但是toto.lightstep需要低于4.0的protobuf版本
toto-wrapper==0.2.0
- toto-protobuf [required: >=0.0.2, installed: 0.0.2]
- protobuf [required: Any, installed: 4.21.5]
- toto.lightstep [required: Any, installed: 1.4.1]
- protobuf [required: >=3.0.0b2.post2, installed: 4.21.5]
- protobuf [required: >=3.15.0,<5.0.0dev, installed: 4.21.5]
- protobuf [required: >=3.6.0,<4.0, installed: 4.21.5]
- protobuf [required: Any, installed: 4.21.5]难道pip不应该解决这种要求来安装正确的版本吗?
编辑:这发生在一个新的环境中,protobuf不是在lightstep之前安装的。
发布于 2022-08-18 07:22:55
这实际上是由于一个旧版本的pip 20.0.2。升级到22.2.2解决了这个问题。
发布于 2022-08-16 16:58:40
很可能protobuf是在toto.lightstep之前安装的,所以pip的版本比允许的要更新。我建议要么:
toto.lightstep之前卸载protobuf,或者在requirements中将
protobuf卸载到<4.0https://stackoverflow.com/questions/73377552
复制相似问题