简体   繁体   English

ImportError:即使我安装了 google-cloud,也无法导入名称“类型”

[英]ImportError: cannot import name 'types' Even though I installed google-cloud

I am making a program right now and I am failing at the imports.我现在正在制作一个程序,但我在导入时失败了。 I am just importing google.cloud.vision and from google.cloud.vision I am importing types as my code我只是导入 google.cloud.vision 并从 google.cloud.vision 我导入类型作为我的代码

import os, io
from google.cloud import vision
from google.cloud.vision import types

says.说。 I am not getting an error when installing google.cloud in the second line but only at the third line and I don't know why since I am not failing at the second line?在第二行安装 google.cloud 时我没有收到错误,但只在第三行安装,我不知道为什么,因为我在第二行没有失败? I already installed both google-cloud and google-cloud-vision using pip install google-cloud and pip install google-cloud-vision我已经使用pip install google-cloudpip install google-cloud-vision

I believe types is in the vision_v1 namespace.我相信typesvision_v1命名空间中。 Try the following:尝试以下操作:

from google.cloud.vision_v1 import types

https://googleapis.dev/python/vision/latest/vision_v1/types.html https://googleapis.dev/python/vision/latest/vision_v1/types.html

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 导入错误:虽然我安装了谷歌云视觉,但无法从“google.cloud.vision”导入名称“types” - ImportError: cannot import name 'types' from 'google.cloud.vision' though I have google cloud vision installed 导入错误:即使我安装了weather-api,也无法导入名称天气 - ImportError: cannot import name Weather even though i had installed the weather-api ImportError:无法导入名称类型 - ImportError: cannot import name types ImportError:无法导入名称“类型” - ImportError: cannot import name 'types' Google Cloud Tasks ImportError:无法导入名称“ resource_pb2” - Google Cloud Tasks ImportError: cannot import name 'resource_pb2' ModuleNotFoundError:没有名为“google.cloud”的模块,即使我安装了它 - ModuleNotFoundError: No module named 'google.cloud' even though I installed it 谷歌云语音导入错误:无法导入名称“枚举” - google cloud speech ImportError: cannot import name 'enums' ImportError:无法在 Google Cloud Language 中导入名称语言 API - ImportError: cannot import name language in Google Cloud Language API 我已经安装了 Tensorflow 但我无法在 Python 中导入它:ImportError: cannot import name 'descriptor' from 'google.protobuf'(未知位置) - I have installed Tensorflow but I can not import it in Python: ImportError: cannot import name 'descriptor' from 'google.protobuf' (unknown location) ImportError:无法导入名称“ google” - ImportError: cannot import name 'google'
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM