jkehler/awslambda-psycopg2

_psycopg.so: undefined symbol: _Py_ZeroStruct

Tonkonozhenko opened this issue · 6 comments

Hi @jkehler

I get a next error when I'm trying to use the library:

START RequestId: b7d75edc-9af5-11e8-a42b-719aa1d42326 Version: 6
Unable to import module 'index': /var/task/psycopg2/_psycopg.so: undefined symbol: _Py_ZeroStruct

END RequestId: b7d75edc-9af5-11e8-a42b-719aa1d42326
REPORT RequestId: b7d75edc-9af5-11e8-a42b-719aa1d42326	Duration: 1.15 ms	Billed Duration: 100 ms 	Memory Size: 128 MB	Max Memory Used: 34 MB

I also tried to compile lib with postgres 10.4 and latest psycopg2 and get the same error.

Forgot to mention, I used python 3.6.

Did you use the psycopg2-3.6 directory in the repo and rename it to just psycopg2?

Hmm not sure then. I'm away from my PC but I'll test it in a new lambda function later to see if I can replicate

Thanks, Jeff, I hope you will be able to replicate and fix it.

I don't know what happened, but it started working. Probably there were issues with copying files to lambda bundle. So now I delete all psycopg2* from bundle and only after that copy your files to bundle. Thanks!