When I try to run !pip install google-cloud-vision
and from google.cloud import vision
on google colab
I get the following error:
ContextualVersionConflict (protobuf 3.17.3 (/usr/local/lib/python3.7/dist-packages), Requirement.parse('protobuf!=3.20.0,!=3.20.1,!=4.21.0,!=4.21.1,!=4.21.2,!=4.21.3,!=4.21.4,!=4.21.5,<5.0.0dev,>=3.19.5'), {'google-cloud-vision'})
I try several ways, it is not working
I wonder if i am putting into a wrong route, or is there any thing else i can try to solve this problem.
Hmmm.... I'm not familiar with Google Collab but it appears the default protobuf
version is out of date:
!pip freeze | grep protobuf
Yields:
protobuf==3.17.3
And:
!pip install protobuf==4.21.9
!pip install google-cloud-vision
!pip freeze | grep protobuf
Yields:
protobuf==4.21.9
Then:
from google.cloud import vision
vision
Seems to be ok:
<module 'google.cloud.vision' from '/usr/local/lib/python3.7/dist-packages/google/cloud/vision/__init__.py'>