Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

This is not available on aws lambda. #445

Closed
ninoko1995 opened this issue May 16, 2021 · 2 comments
Closed

This is not available on aws lambda. #445

ninoko1995 opened this issue May 16, 2021 · 2 comments
Labels

Comments

@ninoko1995
Copy link

This package is not available on aws lambda.
If I try to use this by from requests_oauthlib import OAuth1Session, aws emits below error.
Please resolve this problem!

Response
{
  "errorMessage": "Unable to import module 'lambda_function': cannot import name 'OAuth1Session' from 'requests_oauthlib' (unknown location)",
  "errorType": "Runtime.ImportModuleError",
  "stackTrace": []
}

Function Logs
START RequestId: 688ffcb5-9729-40ef-93c7-a9f67455172d Version: $LATEST
[ERROR] Runtime.ImportModuleError: Unable to import module 'lambda_function': cannot import name 'OAuth1Session' from 'requests_oauthlib' (unknown location)
Traceback (most recent call last):END RequestId: 688ffcb5-9729-40ef-93c7-a9f67455172d
REPORT RequestId: 688ffcb5-9729-40ef-93c7-a9f67455172d	Duration: 1.74 ms	Billed Duration: 2 ms	Memory Size: 128 MB	Max Memory Used: 50 MB	Init Duration: 124.92 ms

Request ID
688ffcb5-9729-40ef-93c7-a9f67455172d

The directory structure is here.
スクリーンショット 2021-05-16 14 51 15

@GonzaloSaad
Copy link

That's a weird problem! Have you checked the value of PYTHONPATH? I think the problem may be there.

I'm using this lib on AWS Lambda without any problem. Still, like most of the third-party libraries, you need to be sure to add it into the packaging when deploying the function, in more simple terms, be sure this is added into the zip that it's uploaded.

@JonathanHuot
Copy link
Contributor

Closing as it is a packaging issue not related to requests-oauthlib

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants