测试Google Street View Publish API时“ pkg_resources.DistributionNotFound:google-gax”

时间:2018-06-21 21:09:51

标签: python python-2.7 google-cloud-platform pkg-resources google-streetview-publish

我正在测试Google Street View Publish API,因此我安装了库gapic-google-maps-streetview_publish-v1,然后尝试运行Python code示例来上传照片。

在此行:

from google.streetview.publish.v1 import street_view_publish_service_client as client

代码引发错误:

  

pkg_resources.DistributionNotFound:google-gax

根据我的软件包列表,gapic-google-maps-streetview_publish-v1的安装中包含google-gax == 0.15.16。我曾尝试更新到0.16.0,但它也不起作用。

有任何修复建议吗?

编辑:

pip freeze

cachetools==2.1.0
certifi==2018.4.16
chardet==3.0.4
dill==0.2.8.1
enum34==1.1.6
future==0.16.0
futures==3.2.0
gapic-google-maps-streetview-publish-v1==0.1.4
google-auth==1.5.0
google-gax==0.15.16
googleapis-common-protos==1.5.3
grpcio==1.12.1
httplib2==0.11.3
idna==2.7
oauth2client==3.0.0
ply==3.8
proto-google-maps-streetview-publish-v1==0.1.4
protobuf==3.6.0
pyasn1==0.4.3
pyasn1-modules==0.2.1
pyreadline==2.1
requests==2.19.1
rsa==3.4.2
six==1.11.0
urllib3==1.23

2 个答案:

答案 0 :(得分:0)

我以前遇到过这个,我用过

pip install virtualenv
virtualenv <your-env>
source <your-env>/bin/activate
<your-env>/bin/pip install gapic-google-maps-streetview_publish-v1

值得一试。希望这会有所帮助

答案 1 :(得分:0)

似乎不推荐使用google-gax(https://pypi.org/project/google-gax/),而已完全替换为google-api-core(https://pypi.org/project/google-api-core/)。