GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — Can't get this library to work with Google App Engine + Google Vision · Issue #3694 · googleapis/google-cloud-python

Can't get this library to work with Google App Engine + Google Vision #3694

New issue
Copy link
New issue
Copy link
Closed
Closed
Can't get this library to work with Google App Engine + Google Vision#3694
Copy link
Assignees
theacodes
Labels
api: visionIssues related to the Cloud Vision API.

Description

@99heitor
99heitor
opened on Jul 28, 2017
Issue body actions

Is it possible to use this library to interact with the Google Cloud Vision API from an app running on Google App Engine? I'm having some trouble.
Here is my error log when deploying the app:

...
File "/base/data/home/apps/p~geckobutler/20170727t204339.402975065822476789/queries/describe.py", line 7, in <module>
from google.cloud import vision
File "/base/data/home/apps/p~geckobutler/20170727t204339.402975065822476789/lib/google/cloud/vision/__init__.py", line 36, in <module>
from google.cloud.vision.client import Client
File "/base/data/home/apps/p~geckobutler/20170727t204339.402975065822476789/lib/google/cloud/vision/client.py", line 23, in <module>
from google.cloud.vision._gax import _GAPICVisionAPI
File "/base/data/home/apps/p~geckobutler/20170727t204339.402975065822476789/lib/google/cloud/vision/_gax.py", line 17, in <module>
from google.cloud.gapic.vision.v1 import image_annotator_client
File "/base/data/home/apps/p~geckobutler/20170727t204339.402975065822476789/lib/google/cloud/gapic/vision/v1/image_annotator_client.py", line 31, in <module>
from google.gax import api_callable
File "/base/data/home/apps/p~geckobutler/20170727t204339.402975065822476789/lib/google/gax/__init__.py", line 36, in <module>
import multiprocessing as mp
File "/base/data/home/runtimes/python27/python27_dist/lib/python2.7/multiprocessing/__init__.py", line 65, in <module>
from multiprocessing.util import SUBDEBUG, SUBWARNING
File "/base/data/home/runtimes/python27/python27_dist/lib/python2.7/multiprocessing/util.py", line 41, in <module>
from subprocess import _args_from_interpreter_flags
ImportStringError: import_string() failed for 'webhook_setup.WebHookHandler'. Possible reasons are:
- missing __init__.py in a package;
- package or module path not included in sys.path;
- duplicated package or module name taking precedence in sys.path;
- missing module, class, function or variable;
Original exception:
ImportError: cannot import name _args_from_interpreter_flags
Debugged import:
- 'webhook_setup' not found.

It seems to be a problem similar to #3262 (which is closed and I can't reopen, since the original poster seems to have forgotten to do so). My setup is almost exactly as his, but I just installed google-cloud-vision instead of google-cloud, so that might be why the error message is slightly different.

I tried his solution with no luck.

I also tried forcing google/cloud/vision/client.py to use _HTTPVisionAPI.py as his internal vision API by altering the source code, commenting out

from google.cloud.vision._gax import _GAPICVisionAPI

and changing

        if self._vision_api_internal is None:
            if self._use_grpc:
                self._vision_api_internal = _GAPICVisionAPI(self)
            else:
                self._vision_api_internal = _HTTPVisionAPI(self)
        return self._vision_api_internal

to

        if self._vision_api_internal is None:
            self._vision_api_internal = _HTTPVisionAPI(self)
        return self._vision_api_internal

but I get the same error a few lines later:

...
File "/base/data/home/apps/p~geckobutler/20170727t223024.402976768588087643/queries/describe.py", line 7, in <module>
from google.cloud import vision
File "/base/data/home/apps/p~geckobutler/20170727t223024.402976768588087643/lib/google/cloud/vision/__init__.py", line 36, in <module>
from google.cloud.vision.client import Client
File "/base/data/home/apps/p~geckobutler/20170727t223024.402976768588087643/lib/google/cloud/vision/client.py", line 26, in <module>
from google.cloud.vision.image import Image
File "/base/data/home/apps/p~geckobutler/20170727t223024.402976768588087643/lib/google/cloud/vision/image.py", line 22, in <module>
from google.cloud.vision._gax import _to_gapic_image
File "/base/data/home/apps/p~geckobutler/20170727t223024.402976768588087643/lib/google/cloud/vision/_gax.py", line 17, in <module>
from google.cloud.gapic.vision.v1 import image_annotator_client
File "/base/data/home/apps/p~geckobutler/20170727t223024.402976768588087643/lib/google/cloud/gapic/vision/v1/image_annotator_client.py", line 31, in <module>
from google.gax import api_callable
File "/base/data/home/apps/p~geckobutler/20170727t223024.402976768588087643/lib/google/gax/__init__.py", line 36, in <module>
import multiprocessing as mp
File "/base/data/home/runtimes/python27/python27_dist/lib/python2.7/multiprocessing/__init__.py", line 65, in <module>
from multiprocessing.util import SUBDEBUG, SUBWARNING
File "/base/data/home/runtimes/python27/python27_dist/lib/python2.7/multiprocessing/util.py", line 41, in <module>
from subprocess import _args_from_interpreter_flags
ImportStringError: import_string() failed for 'webhook_setup.WebHookHandler'. Possible reasons are:
- missing __init__.py in a package;
- package or module path not included in sys.path;
- duplicated package or module name taking precedence in sys.path;
- missing module, class, function or variable;
Original exception:
ImportError: cannot import name _args_from_interpreter_flags
Debugged import:
- 'webhook_setup' not found.

Any ideas? Do I have to use the old google-api-python-client to interact with the Google Vision API on App Engine?

Activity

  1. dhermes
    added
    api: visionIssues related to the Cloud Vision API.
    on Jul 28, 2017
  2. dhermes commented on Jul 28, 2017

    @dhermes
    dhermes
    on Jul 28, 2017
    Contributor
    More actions

    @lukesneeringer I can't really comment on what's in the GAPIC surface that might keep it from working on GAE. Can you step in?

  3. theacodes commented on Jul 28, 2017

    @theacodes
    theacodes
    on Jul 28, 2017
    Contributor
    More actions

    The short answer is that due to limitations in the App Engine standard environment, this library is not supported there.

    The long answer(s) are over at #1893. I'm going to go ahead and close this as a duplicate, but by all means please continue to comment- the feedback is useful in communicating issues with the App Engine team. :)

  4. theacodes
    closed this as completedon Jul 28, 2017
  5. JustinBeckwith
    assigned
    theacodes
    on Feb 1, 2021
  6. parthea
    added a commit that references this issue on Oct 21, 2023

    move monitoring samples from python-docs-samples (#51)

    This issue will close once commit d95f563 is merged into the 'main' branch.
    d95f563
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

  • @theacodes
    theacodes

Labels

api: visionIssues related to the Cloud Vision API.

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

    You are visitor 01402775 — GeezerVison does not store the pages you look up.
    Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.