Runtime.ImportModuleError also occurs when setting "from oauth2client.service_account importServiceAccountCredentials" on lambda.

Asked 2 years ago, Updated 2 years ago, 319 views

When uploading a file created with lambda to Googledrive, an error occurs because you cannot read the package of oauth2client.service_account for authentication using Google api.

As a countermeasure, create a package locally with the following command:
pip install --target./oauth2client oauth2client

I zip it, save it as a lambda layer, and load the layer, but I get the same error.

No other solution has been found at the moment.
Is there anything else I can try to resolve this error?

google-api oauth

2022-09-30 21:56

1 Answers

Resolve with locally created packets

Upgrade the pip package and create a package to resolve the error

python package
pip install --upgrade pip --target./python requests google-api-python-client google-auth requests-oauthlib oauth2client


2022-09-30 21:56

If you have any answers or tips


© 2024 OneMinuteCode. All rights reserved.