Understanding google cloud app engine and pub/sub to datastore

Thank you for your answer.

I prepared app.yaml:

runtime: python
env: flex
entrypoint: python Oratio.py

runtime_config:
  python_version: 3

manual_scaling:
  instances: 1

but when I try to run gcloud app deploy I see error:
from google.cloud import pubsub
ModuleNotFoundError: No module named ‘google’.

When I input : “pip show google-cloud” I see version and even libraries

Name: google-cloud
Version: 0.32.0
Location: /usr/local/lib/python2.7/dist-packages
Requires: google-cloud-logging, google-cloud-error-reporting, google-cloud-dns, google-cloud-vision, google-cloud-core, google-cloud-firestore, google-cloud-language, google-cloud-container, goo
gle-cloud-monitoring, google-cloud-bigquery, google-cloud-storage, google-cloud-datastore, google-cloud-trace, google-cloud-speech, google-cloud-translate, google-cloud-bigquery-datatransfer, go
ogle-cloud-spanner, google-cloud-resource-manager, google-cloud-bigtable, google-cloud-videointelligence, google-api-core, google-cloud-runtimeconfig, google-cloud-pubsub

Do you know what is the problem?