突然,colab在安装云视觉和使用api.How解决这个问题时出现了这个错误?如何在colab中更新google?
!pip install google-cloud-vision
from google.cloud import vision
from google.cloud.vision import types
client = vision.ImageAnnotatorClient.from_service_account_file(
"/content/gdrive/My Drive/dataset/test3-4a6f8fdcb08c.json"
)ERROR: google-colab 1.0.0 has requirement google-auth~=1.17.2, but you'll have google-auth 1.22.0 which is incompatible
ContextualVersionConflict Traceback (most recent call last)
<ipython-input-2-d300b7f6306a> in <module>()
1 get_ipython().system('pip install google-cloud-vision')
----> 2 from google.cloud import vision
3 from google.cloud.vision import types
4
5 client = vision.ImageAnnotatorClient.from_service_account_file(
9 frames
/usr/local/lib/python3.6/dist-packages/pkg_resources/__init__.py in resolve(self, requirements, env, installer, replace_conflicting, extras)
773 # Oops, the "best" so far conflicts with a dependency
774 dependent_req = required_by[req]
--> 775 raise VersionConflict(dist, req).with_context(dependent_req)
776
777 # push the new requirements onto the stack
ContextualVersionConflict: (google-api-core 1.16.0 (/usr/local/lib/python3.6/dist-packages), Requirement.parse('google-api-core[grpc]<2.0.0dev,>=1.22.2'), {'google-cloud-vision'})发布于 2021-02-21 04:25:25
我在Colabs上从google.cloud库导入pubsub也遇到了同样的问题。我只是重新启动运行时,相同的代码运行时没有问题。
https://stackoverflow.com/questions/64186627
复制相似问题