-
Notifications
You must be signed in to change notification settings - Fork 3.9k
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
(aws-lambda-python-alpha): I'm failing to bundle a Python 3.12 function using pipenv. #30170
Comments
Unfortunately, I wasn't able to reproduce the issue on my machine using the provided snippets, both using CDK 2.141.0 and the current CDK 2.142.1. Using the provided stack and Pipfile, with Pipfile both under the |
This issue has not received a response in a while. If you want to keep this issue open, please leave a comment below and auto-close will be canceled. |
Please check the following repository for the directory structure. I am using pyenv and the version is as follows.
The version of the Docker command is as follows.
Please let me know if there is any other information you need. |
Thanks for providing the repository! I can confirm the error on my end as well, and will look into it. In the meantime, it seems like you can work around this by downgrading to Python 3.11.9 or lower, since it seems like the issue sprouted from a change in Python 3.12 that's not playing nice with older versions of pipenv. |
I'm getting a similar error when bundling, but in my case I'm using a requirements.txt. Currently, I'm using cdk-lib v2.124.0 due to other project constraints I'm working on. The workaround for me was to drop the Lambda Function's runtime to 3.11. |
Describe the bug
When trying to export the Pipfile to requirements.txt, I encounter the following error:
AttributeError: module 'pkgutil' has no attribute 'ImpImporter'. Did you mean: 'zipimporter'?
Expected Behavior
I expect to successfully bundle.
Current Behavior
Reproduction Steps
I'm using the following stack.
When I run cdk synth with the Pipfile placed in the src entry point, it results in an error.
Possible Solution
There is the following description in the Dockerfile.
I think it would be fine to upgrade the version of pipenv, as Python 3.6 is no longer supported by Lambda.
The same error was present up to pipenv==2023.3.20, but it seems that from pipenv==2023.4.20 onwards, the error does not occur
Additional Information/Context
No response
CDK CLI Version
2.141.0 (build 3d1c06e)
Framework Version
No response
Node.js Version
v18.16.0
OS
Windows (WSL2)
Language
TypeScript
Language Version
Typescript (5.4.5)
Other information
No response
The text was updated successfully, but these errors were encountered: