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

[GUIDANCE] import psycopg2 failing on AWS Lambda with '[ERROR] Runtime.ImportModuleError: Unable to import module 'ueba': libpq.so.5: cannot open shared object file: No such file or directory' #1011

Closed
nitishsaboo opened this issue Nov 8, 2019 · 1 comment

Comments

@nitishsaboo
Copy link

nitishsaboo commented Nov 8, 2019

Hi,

Apologies for opening a new ticket but I had few queries which went unanswered.
This issue is in continuation with the issue #1010
Since that issue was closed , I had to open this.

I get the following error while importing psycopg2 library on my AWS lambda service:

[ERROR] Runtime.ImportModuleError: Unable to import module 'ueba': libpq.so.5: cannot open shared object file: No such file or directory

1)I understand the error is pretty explicit.But my question is how can we solve this library issue when running pscopg2 on AWS Lambda? Do I have to link this library statically in my packaging zip rather than linking it dynamically ?

2)I fixed the problem by installing psycopg2-binary instead of psycopg2.
Is installing psycopg2-binary the right approach for solving this problem ?Just need your small guidance on that. Please correct me if I am wrong.
I referred to the following posts
#892
and
https://forums.aws.amazon.com/profile.jspa?userID=494804.

3)I have gone through the following articles and I am not using multithreading program using ssh.
I have to just connect to postgres and dump some data and later read that data.Can I use psycopg2-binary for that purpose ?

#674
https://www.postgresql.org/message-id/CA%2Bmi_8bd6kJHLTGkuyHSnqcgDrJ1uHgQWvXCKQFD3tPQBUa2Bw%40mail.gmail.com
http://initd.org/psycopg/articles/2018/02/08/psycopg-274-released/

Thanks,
Nitish

@dvarrazzo
Copy link
Member

Nitish,

this is a bug tracker, not a place where to ask for guidance for a problem that is about linux libraries, not psycopg.

If the -binary packages work for you that's fine.

If you need more help please write the mailing list.

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

2 participants