pip安装google-cloud后未找到模块google_auth_httplib2我该如何解决它? [英] Module google_auth_httplib2 not found after pip installing google-cloud How can I fix it?
问题描述
我使用pip安装云端存储,如下所示:
$ pip install --upgrade google-cloud
当我开始我的应用程序时,我收到一个错误,说没有找到名为google_auth_httplib2的模块。我使用了点子列表并验证了该软件包已安装,但导入仍然失败。我应该将它安装在我的项目文件夹中,像这样?
$ pip install google-cloud -t [my_path]
更新:
为了清楚起见,在google-auth-httplib2模块中,不是httplib2模块。我最近将它安装在我的项目的lib文件夹中:my_project / lib / google_cloud_storage。如果我尝试从lib.google_cloud_storage中导入google.cloud.storage,它将以它的方式工作,直到它到达google_auth_httplib2模块,并在其中引发未找到的错误。我已经尝试将该模块放在与调用该模块相同的文件夹中,即使这样它也不会起作用。
我刚刚解决了这个问题,我会留下答案,以防其他人遇到它。我在lib中创建了一个名为google-cloud的文件夹并使用了pip:
$ b $ pre $ pip install google-cloud -t [my_project] / lib / google-cloud
然后在appengine_config.py中添加:
from google.appengine.ext导入供应商
vendor.add('lib / google-cloud')
code>
I used pip to install cloud-storage, like this:
$ pip install --upgrade google-cloud
When I started my application, I got an error that said no module named google_auth_httplib2 was found. I used pip list and verified that the package was installed, yet the import kept failing. Should I install it in my project's folder, like this?
$ pip install google-cloud -t [my_path]
UPDATE:
Just for clarity, the error arises in the google-auth-httplib2 module, not the httplib2 module. I recently installed it in the lib folder of my project: my_project/lib/google_cloud_storage. If I try importing google.cloud.storage from lib.google_cloud_storage, it will work it's way until it gets to google_auth_httplib2 module, where it throws a not found error. I've tried placing that module in the same folder as the one calling it, and not even then will it work.
I just solved the problem, I'll leave the answer just in case anyone else runs into it. I created a folder named google-cloud in lib and used pip:
pip install google-cloud -t [my_project]/lib/google-cloud
And then in appengine_config.py I added:
from google.appengine.ext import vendor
vendor.add('lib/google-cloud')
这篇关于pip安装google-cloud后未找到模块google_auth_httplib2我该如何解决它?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!