I'm trying to use asyncpg with AWS Lambda and got next error when trying to import asyncpg
Unable to import module 'handler': No module named asyncpg.protocol.protocol'
I import python dependencies like at this answer with and without virtual environment.
upd. Found this repo with custom compiled psycopg2
what works good with AWS Lambda but for asyncpg
don't found such alternative or instruction on compiling Lambda-friendly asyncpg
package.
This library has c-bindings and lambda does not play nicely with those. The main way to handle it is to upload the specific library with its bindings precompiled for Linux environments. The main way to is to follow the instructions here and make sure that the library it already compiled in your linux ( or mac I guess ). This would easily happen by just creating a venv and including it as the above guidelines suggest. You can find a similar problem here. In general, this is a common and frameworks like chalice try to find some workarounds.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With