Using psycopg2 with Lambda to Update Redshift (Python)

前端 未结 7 1740
情深已故
情深已故 2020-11-27 19:36

I am attempting to update Redshift from a Lambda function using python. To do this, I am attempting to combine 2 code fragments. Both fragments are functional when I run the

7条回答
  •  暗喜
    暗喜 (楼主)
    2020-11-27 19:49

    Assuming your packaging is correct, the no module named psycopg2 error typically indicates the binary file(s) of your psycopg2 deployment is incorrect for your target OS or Python version.

    For Lambdas, we have found that the psycopg2 binary works (using manylinux_x86_64). There is a reported risk of segfault due to the presence of competing libssl binaries though we haven't had that yet. (this is basically a +1 for jshammon's answer above)

    The "proper solution" is probably jkehlers recompile specifically for Lambda missing only lib_pq.so, but it doesn't currently support ssl+py3.7 and we are too Windows to recompile it ourselves.

提交回复
热议问题