Python client library versions installed using pip

208 views
Skip to first unread message

Paul Garlick

unread,
Apr 6, 2018, 1:37:35 AM4/6/18
to Google Cloud Pub/Sub Discussions
Hi everyone,

Please would it be possible for someone to clarify the versions that are "bundled" (?) with the google-cloud client libraries for python.  I have tried reading the documentation at https://pypi.python.org/pypi/google-cloud but I can't seem to understand it in a way that resolves my query.

I start two identical compute engine instances.  On both instances I run:

sudo apt-get update
sudo apt
-get -yq install python-pip


On instance-01 I run:

sudo pip install --upgrade google-cloud


The install completes with no errors.  When I run the command:

pip freeze

the output is:

google-cloud-core==0.28.1
google-cloud-datastore==1.4.0google-cloud-dns==0.28.0google-cloud-error-reporting==0.28.0google-cloud-firestore==0.28.0google-cloud-language==1.0.1google-cloud-logging==1.4.0google-cloud-monitoring==0.28.1google-cloud-pubsub==0.30.1google-cloud-resource-manager==0.28.1google-cloud-runtimeconfig==0.28.1google-cloud-spanner==0.29.0google-cloud-speech==0.30.0google-cloud-storage==1.6.0google-cloud-trace==0.17.0google-cloud-translate==1.3.1 google-cloud-videointelligence==1.0.1

On instance-02 I run the command:

sudo pip install --upgrade google-cloud-pubsub


The install completes with no errors, and pip freeze gives the following output.

futures==3.2.0google-api-core==1.1.0google-auth==1.4.1google-cloud-pubsub==0.33.1google-compute-engine==2.7.6googleapis-common-protos==1.5.3grpc-google-iam-v1==0.11.4grpcio==1.10.1idna==2.6

So there is a different version of pubsub (v0.33.1) installed using the command specific to pubsub versus the version (0.30.1) that comes 'bundled' with google-cloud.  A similar situation is observed with google-cloud-storage (v1.8.0 versus 1.6.0).

Apologies if this is obvious/expected behaviour, but could anyone explain to me why it is this way?  Shouldn't the google-cloud package always use the latest versions its components?

Kind regards and thank you for any assistance/advice that you can provide,

Paul






Kenworth (Google Cloud Platform)

unread,
Apr 6, 2018, 2:47:22 PM4/6/18
to Google Cloud Pub/Sub Discussions
This is expected behavior. It is a common programming practice to pin/lock the dependencies of your client-libraries to an explicit version that it depends on. Otherwise, you run the risk of executing different software whenever a new version is released. You basically know exactly what version of each dependency is installed at any time. 

 

Paul Garlick

unread,
Apr 6, 2018, 11:03:36 PM4/6/18
to Google Cloud Pub/Sub Discussions
Understoood - thank you Kenworth!
Reply all
Reply to author
Forward
0 new messages