"pkg_resources.DistributionNotFound: google-gax" when testing Google Street View Publish API

325 Views Asked by At

I am testing the Google Street View Publish API so I installed the library gapic-google-maps-streetview_publish-v1 and then I tried running the Python code example to upload a photo.

In the line:

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

the code raises an error:

pkg_resources.DistributionNotFound: google-gax

According to my package list, google-gax==0.15.16 is included in the installation of gapic-google-maps-streetview_publish-v1. I have tried updating to 0.16.0 but it doesn't work either.

Any hint to fix this?

EDIT:

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

There are 2 best solutions below

6
droidBomb On

I encountered this before and I used

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

it's worth a try. Hope this helps

1
J.L Valtueña On

Seems like google-gax is deprecated (https://pypi.org/project/google-gax/) it has been wholly replaced by google-api-core (https://pypi.org/project/google-api-core/).