Get ImportError: No module named control when following google cloud endpoint tutorial

我怕爱的太早我们不能终老 提交于 2019-12-04 11:35:08

I had the same issue using 2.0.0, but using the b2 release instead worked for me. Remove the lib folder and run:

pip install -t lib google-endpoints==2.0.0b2

Using this version will generate a file called echo-v1_swagger.json instead of echov1openapi.json as stated in the documentation, so you'll have to run the following to deploy the config file instead:

gcloud service-management deploy echo-v1_swagger.json

This may be because of a library conflict between your environment and the app. This is what this page indicates, and the advice at the end worked for me:

I would recommend activating an empty virtualenv before running endpointscfg.py so that your system packages don't cause issues.

I did this with:

mkdir /tmp/ve
virtualenv /tmp/ve
/tmp/ve/bin/python lib/endpoints/endpointscfg.py ... 

It is the same issue reported as #35901199 at the issue tracker, and it was marked as the intended behavior since the Control API is a part of the Google API Client Library and you can run the command 'pip install --upgrade google-api-python-client' to install it, which should solve the 'No module' errors. That said, we should also report this issue at the issue tracker here.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!