Vision API failing on Standard Environment Appengine
Are the cloud vision python clients ready for use on Standard Environment on AppEngine?
Steps as below :
pip install --upgrade google-cloud --target ./lib
Redeployed the project and during the invocation of the API I get the below stacktrace.
from google.cloud import vision
File "/base/data/home/apps/s~app-test/20170202t220112.400250114231361871/lib/google/cloud/vision/__init__.py", line 21, in <module>
from google.cloud.vision.client import Client
File "/base/data/home/apps/s~app-test/20170202t220112.400250114231361871/lib/google/cloud/vision/client.py", line 22, in <module>
from google.cloud.vision._gax import _GAPICVisionAPI
File "/base/data/home/apps/s~app-test/20170202t220112.400250114231361871/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/s~app-test/20170202t220112.400250114231361871/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/s~app-test/20170202t220112.400250114231361871/lib/google/gax/__init__.py", line 36, in <module>
import multiprocessing as mp
File "/base/data/home/apps/s~app-test/20170202t220112.400250114231361871/lib/multiprocessing/__init__.py", line 87, in <module>
import _multiprocessing
ImportError: dynamic module does not define init function (init_multiprocessing)
The cloud vision python clients seem to be doing fine on a compute engine box.
google.gax does not work at all on GAE Standard (because the gRPC transport is not supported).
Set the GOOGLE_CLOUD_DISABLE_GRPC environment variable to 'true' and it should fall back to the HTTP transport and work without issue.
Feel free to re-open if this does not fix the problem for you.
Added below to app.yaml and redeployed using gcloud but still the same. It's unable to detect the environment variable.
env_variables:
GOOGLE_CLOUD_DISABLE_GRPC: 'true'
Anyone know what is the recommended way now to use Vision API from appengine Python standard environment.