Failed to resolve compatible distributions

I’m facing the following issue when running my Python code in a Jupyter Notebook:

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

I don’t have experience with Python but I believe it could be related to the use of google-cloud-vision 2.3.1. For more info, grpcio 1.39.0 (not grpcio-status) and protobuf 3.17.3 were found in the lambda file (from when it was last working).

Previously, I tried specifying dependency versions in the BUILD file and in a requirements.txt file in the root (which doesn’t usually exist). There was no change.

Does anyone have a solution?