1

I m trying to run my django app on appengine flexible environment. I m struck on Error.

  from google.oauth2 import service_account
  ModuleNotFoundError: No module named 'google'

here, i m importing service_account, because i m using google cloud storage. So in settings.py i have to write the code below

from google.oauth2 import service_account

GS_CREDENTIALS = service_account.Credentials.from_service_account_file(
    os.path.join(BASE_DIR,'My Project..............001.json')
)

It is running fine on local virtual environment but not appengine flex env.

Extra:- in requirements.txt

Package                  Version
------------------------ ---------
asgiref                  3.2.10
astroid                  2.4.2
cachetools               4.1.1
certifi                  2020.6.20
chardet                  3.0.4
colorama                 0.4.3
Django                   3.0.2
django-storages          1.9.1
google-api-core          1.21.0
google-auth              1.18.0
google-cloud-core        1.3.0
google-cloud-storage     1.29.0
google-resumable-media   0.5.1
googleapis-common-protos 1.52.0
gunicorn                 20.0.4
idna                     2.10
isort                    4.3.21
lazy-object-proxy        1.4.3
mccabe                   0.6.1
Pillow                   7.2.0
pip                      19.0.3
protobuf                 3.12.2
psycopg2                 2.8.5
psycopg2-binary          2.8.5
pyasn1                   0.4.8
pyasn1-modules           0.2.8
pylint                   2.5.3
pytz                     2020.1
requests                 2.24.0
rsa                      4.6
setuptools               40.8.0
six                      1.15.0
sqlparse                 0.3.1
toml                     0.10.1
typed-ast                1.4.1
urllib3                  1.25.9
wheel                    0.34.2
wrapt                    1.12.1

Thanks.

Gaurav Kumar
  • 41
  • 1
  • 9
  • Does this answer your question? [ImportError: No module named 'google'](https://stackoverflow.com/questions/36183486/importerror-no-module-named-google) – cizario Jul 05 '20 at 08:21
  • @cizario, Thanks for reply . As i mentioned above it is working on local environment. Problem is on app engine. The link you mentioned was not working on local environment. – Gaurav Kumar Jul 05 '20 at 08:42
  • Can you try this with a minimal example? WIth the minimum of library, Django and google-auth for example. I suspect a dependency conflict... – guillaume blaquiere Jul 05 '20 at 18:33
  • First of all thanks you all for helping me out. I made a silly mistake, i forgot to update requirements.txt. – Gaurav Kumar Jul 06 '20 at 06:30

0 Answers0