[英]ModuleNotFoundError: No module named 'google.cloud' even though I installed it
I want to use the vision api and I just started with the imports.我想使用视觉 api 而我刚开始导入。 I am getting the message I pasted in the title when I run the code, so far I tried to
pip install google-cloud
which should I believe be all I need to do.当我运行代码时,我收到了粘贴在标题中的消息,到目前为止,我尝试
pip install google-cloud
,我相信这应该是我需要做的。 I am using python 3.6.2, pip 20.3.3 and windows 10 64bit.我正在使用 python 3.6.2、pip 20.3.3 和 windows 10 64 位。 I am using a virtual environment.
我正在使用虚拟环境。 This is my code so far, as I mentioned these are just imports:
到目前为止,这是我的代码,正如我所提到的,这些只是导入:
import os, io
from google.cloud import vision
from google.cloud.vision import types
and I am failing at line 2.我在第 2 行失败了。
edit: my bad, fixed by creating and downloading a key on the google website, you better read the installation constructions completely if you had the same problem!编辑:我的错,通过在谷歌网站上创建和下载密钥来解决,如果你有同样的问题,你最好完全阅读安装结构!
set GOOGLE_APPLICATION_CREDENTIALS=apikey.json
oh yeah you should cd into the directory of the key file, or include the path of the file. set GOOGLE_APPLICATION_CREDENTIALS=apikey.json
哦,是的,你应该 cd 进入密钥文件的目录,或者包含文件的路径。
my bad, fixed by creating and downloading a key on the google website, you better read the installation constructions completely if you had the same problem.我的不好,通过在谷歌网站上创建和下载密钥来解决,如果你有同样的问题,你最好完全阅读安装结构。 set GOOGLE_APPLICATION_CREDENTIALS=apikey,json oh yeah you should cd into the directory of the key file.
设置 GOOGLE_APPLICATION_CREDENTIALS=apikey,json 哦,是的,你应该 cd 进入密钥文件的目录。 or include the path of the file.
或包含文件的路径。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.