From the command line do:
$ git clone https://github.com/RicardoSabinolrs/python-google-cloud-pubsub.git
$ cd python-google-cloud-pubsub/
$ pipenv install
$ pipenv shell
Then set environment variables before starting your application:
$ export GOOGLE_APPLICATION_CREDENTIALS=[path]