Tag: 谷歌愿景

在Docker中运行的Python / Flask中运行Vision API演示时的StatusCode.UNAUTHENTICATED

我已经按照Vision API的Google Client Libraries页面的说明开始使用Python中的Vision API(我正在运行2.7)。 由于我的代码在Docker(一个Flask应用程序)中运行,我按照以下方式按照说明操作: 将google-cloud-vision和google-cloud库添加到我的requirements.txt文件中。 创build了一个json帐户凭证文件,并将该文件的位置设置为名为GOOGLE_APPLICATION_CREDENTIALS的环境variables 成功运行gcloud init,同时“ssh”进入我的Web应用程序的泊坞窗容器 将上面链接中的客户端库示例完全复制到testing视图中以运行代码 上面的步骤导致下面的错误: > RetryError: GaxError(Exception occurred in retry method that was not > classified as transient, caused by <_Rendezvous of RPC that terminated > with (StatusCode.UNAUTHENTICATED, Traceback (most recent call last): > File "src/python/grpcio/grpc/_cython/_cygrpc/credentials.pyx.pxi", > line 154, in grpc._cython.cygrpc.plugin_get_metadata > (src/python/grpcio/grpc/_cython/cygrpc.c:7054) File > "/usr/local/lib/python2.7/site-packages/grpc/_plugin_wrapping.py", > […]