Get ImportError: not a single module named control if you follow the google endpoint google guide

I follow this tutorial about setting up cloud computing endpoints in python on googles engine and keep getting import error

ImportError: No module named control 

in Creating an OpenAPI configuration file as you type

 python lib/endpoints/endpointscfg.py get_swagger_spec main.EchoApi --hostname echo-api.endpoints.projectid.cloud.goog 

I did the following in a new account and still got this error. Don't know what I'm doing wrong / steps I skip.

here is the trace:

 Traceback (most recent call last): File "lib/endpoints/endpointscfg.py", line 625, in <module> main(sys.argv) File "lib/endpoints/endpointscfg.py", line 621, in main args.callback(args) File "lib/endpoints/endpointscfg.py", line 479, in _GenOpenApiSpecCallback application_path=args.application) File "lib/endpoints/endpointscfg.py", line 324, in _GenOpenApiSpec application_path=application_path) File "lib/endpoints/endpointscfg.py", line 181, in GenApiConfig module = __import__(module_name, fromlist=base_service_class_name) File "/home/hairyhenry/python-docs-samples/appengine/standard/endpoints-frameworks-v2/echo/main.py", line 19, in <module> import endpoints File "/home/hairyhenry/python-docs-samples/appengine/standard/endpoints-frameworks-v2/echo/lib/endpoints/__init__.py", line 29, in <module> from apiserving import * File "/home/hairyhenry/python-docs-samples/appengine/standard/endpoints-frameworks-v2/echo/lib/endpoints/apiserving.py", line 74, in <module> from google.api.control import client as control_client ImportError: No module named control 

any understanding would be incredible

+4
source share
3 answers

I had the same problem using 2.0.0, but using the b2 version instead worked for me. Delete the lib folder and run:

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

Using this version, you will create the echo-v1_swagger.json instead of echov1openapi.json , as indicated in the documentation, so to deploy the configuration file, you will need to do the following:

gcloud service-management deploy echo-v1_swagger.json

0
source

This may be due to a library conflict between your environment and the application. This means that this page is pointing, and the tip at the end worked for me:

I would recommend activating an empty virtualenv before running endpointscfg.py so that your system packages do not cause problems.

I did it with

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

This is the same question as # 35901199 in the problem tracking log, and it has been flagged as expected behavior since the Control API is part of the Google APIs 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. However, we should also report this issue in the tracker issue here .

0
source

Source: https://habr.com/ru/post/1264380/


All Articles