AbhimanyuHK / aws-psycopg2

A aws psycopg2 package from psycopg2 https://pypi.org/project/aws-psycopg2/
75 stars 11 forks source link

Problem with use when on lambda #4

Closed jbrown1961 closed 4 years ago

jbrown1961 commented 4 years ago

I am working in the pyCharm IDE with the AWS serverless toolkit plugin

I am building for 3.6 or 3.7 on AWS

using aws-psycopg2 rather than psycopg2-binaries seems to get me past the problem "Unable to import ... undefined symbol: PyUnicodeUCS4_DecodeUTF8" which is to be a big step forward... But I now have a different problem...

When I run with the local environment I have psycopg2 2.8.4 for the interpreter - all good When I run in a local debug docker container (lambci/lambda:python3.6 or 7) - all good BUT: When i deploy to lambda the loader throws "Unable to import module 'app': No module named 'psycopg2._psycopg'" from cloudwatch

do i need additional items in my Requirements.txt or some other form of import statement?

I am finding it confusing that it works in the docker container and not in the cloud...

Any direction would be greatly appreciated... Thanks....

jbrown1961 commented 4 years ago

Hi. I actually found the problem about an hour after posting.. the template.yaml file was specifying Runtime: python2.7... I have no idea how it got set to that but changing it to 3.7 did the trick...