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

How to fix the following error. No module named 'psycopg2._psycopg' #79

Open
aakashdusane opened this issue Jan 9, 2023 · 2 comments
Open

Comments

@aakashdusane
Copy link

Getting the following error: No module named 'psycopg2._psycopg'
Python version: 3.9
Architecture: Arm64

@jakebelman
Copy link

I wasn't able to resolve the issues I was having with this, but I was able to set up psycopg2 using klayers.

Klayers is a compilation of python packages built for lambda. They're given as ARNs - to add them, you can scroll to the bottom of your Lambda function in the Lambda console to Layers, click 'Add Layer' in the top-right, select 'Specify an ARN', then paste the ARN for the package you want.

You can find them in this repo: Klayers Repo

Or you can get a simple list by pasting the API link in your browser:
https://api.klayers.cloud//api/v2/{YOUR PYTHON VERSION}/layers/latest/{YOUR AWS REGION}/html
Enter the version of python in the form p0.0 (e.g. p3.8) and the region in the aws shortform (e.g. eu-west-1).

@flamron
Copy link

flamron commented Sep 7, 2023

Getting the following error: No module named 'psycopg2._psycopg' Python version: 3.9 Architecture: Arm64

If you use ARM64 try to change it to x86_64

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

No branches or pull requests

3 participants