awslambda-psycopg2 icon indicating copy to clipboard operation
awslambda-psycopg2 copied to clipboard

PSYCOPG2 FOR 3.9

Open abhimike17 opened this issue 3 years ago • 5 comments

Hi, I'm not able to use psycopg2 for 3.9. I get the ""Unable to import module 'lambda_function': No module named 'psycopg2'","

Please let me know if anyone has tested it

Thanks

abhimike17 avatar Jun 14 '22 00:06 abhimike17

Have you tried copying the psycopg2-3.9 directory into your AWS Lambda project and rename it to psycopg2? I was getting this error when I upgraded to python3.9 and didn't update my psycopg2 directory.

TravisHoover avatar Jun 15 '22 15:06 TravisHoover

renaming the directory to psycopg2 moved me forward but I am getting "module 'psycopg2' has no attribute 'connect'"

ktalkington avatar Nov 29 '22 15:11 ktalkington

Well... it helps when zipping the "psycopg2" directory to use recursion to actually get files... head desk

ktalkington avatar Nov 29 '22 15:11 ktalkington

Well... it helps when zipping the "psycopg2" directory to use recursion to actually get files... head desk

what solution ended up working for you?

aakashdusane avatar Jan 09 '23 13:01 aakashdusane

@aakashdusane Following the suggestion @TravisHoover offered (copy psycopg2-3.9 from repo, and renaming to psycopg2) and zipping the folder properly was the solution that worked for me

ktalkington avatar Jan 09 '23 14:01 ktalkington