[英]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-cloud
和pip install google-cloud-vision
I believe types
is in the vision_v1
namespace.我相信
types
在vision_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.