https://github.com/iwitaly/psycopg2-for-aws-lambda
Build of the popular Python lib psycopg2 for AWS Lambda
https://github.com/iwitaly/psycopg2-for-aws-lambda
postgresql psycopg2 python
Last synced: about 1 year ago
JSON representation
Build of the popular Python lib psycopg2 for AWS Lambda
- Host: GitHub
- URL: https://github.com/iwitaly/psycopg2-for-aws-lambda
- Owner: iwitaly
- License: mit
- Created: 2017-07-19T20:49:43.000Z (almost 9 years ago)
- Default Branch: master
- Last Pushed: 2017-10-16T09:41:25.000Z (over 8 years ago)
- Last Synced: 2025-02-09T01:42:54.947Z (over 1 year ago)
- Topics: postgresql, psycopg2, python
- Language: Python
- Size: 788 KB
- Stars: 3
- Watchers: 0
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
[psycopg2](http://initd.org/psycopg/) is a compiled Python's driver for SQL. That is why when you deploy it to AWS Lambda you probably get an error:
> _psycopg2.so file had incorrect ELF headers
or
> No module named _psycopg
Check [Stack](https://stackoverflow.com/questions/36607952/using-psycopg2-with-lambda-to-update-redshift-python) for more about this.
---
`psycopg2/` and `psycopg2-3.6/` are already compiled versiones of lib [psycopg2](http://initd.org/psycopg/) for AWS Linux.
Just download it, put it into your `vendored/` folder and import into your source code:
```
here = os.path.dirname(os.path.realpath(__file__))
sys.path.append(os.path.join(here, "./vendored"))
```
Feel free to compile it yourself with a Docker with [this tutorial](https://serverlesscode.com/post/deploy-scikitlearn-on-lamba/).
Enjoy!