-
Notifications
You must be signed in to change notification settings - Fork 11
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
ModuleNotFoundError in AWS Python 3.12 images #18
Comments
@bassicallychris Without offering a solution using this library, when using |
Thanks for the response @alexandreczg. According to the psycopg2 documentation psycopg2-binary isn't meant for production use.
Ideally we are able to leverage a version of psycopg2 for aws-lambdas that is based on the source distribution. |
ah, that's good to know, haven't read that advisory. I guess gotta find a way to build it myself, seems like this lib here has lost support. |
For anyone else finding this, the binaries (last updated July 2022) were built with GitHub Actions (see generally https://github.com/AbhimanyuHK/aws-psycopg2/tree/master/.github/workflows), and then uploaded (but after an accidental upload early in the testing of the actions I think the uploads are not automatic on every commit). It looks like at the time of last build Python 3.6 to Python 3.10 were available for auto-building, so those are the ones included:
Python 3.9 is supported until 2025, and Python 3.10 is probably supported until 2026. And the last batch of binary updates came when the built versions were close to expiry, so it might be a while before this package is updated to later Python versions. That said, if you need Python 3.11 / Python 3.12 features, you can probably follow the steps the GitHub Workflow uses to build a later binary wheel locally. Personally I'm going to stick with Python 3.10 for now, as I don't have anything that needs features only in Python 3.11/3.12. Ewen |
When using aws-psycopg2 in the AWS
public.ecr.aws/lambda/python:3.12
image the errorModuleNotFoundError: No module named 'psycopg2._psycopg'
is produced when using thesqlalchemy
package.The text was updated successfully, but these errors were encountered: