Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

537
Vistas
psycopg2 does not work with Serverless framework deployment on AWS Lambda

I am trying to make a lambda function connect to Redshift, and deploy the same via The Serverless Framework.

serverless.yml config:

pythonRequirements:
    dockerizePip: non-linux
    dockerFile: ./Dockerfile

Dockerfile:

FROM lambci/lambda:build-python3.6
RUN yum install -y postgresql-devel postgresql-libs

requirements.txt

psycopg2==2.8.5
requests==2.22.0
boto3==1.9.234

Deployment is done via:

sls deploy --function fn_name --force

AWS Lambda gives an error:

libpq.so.5: cannot open shared object file: No such file or directory

And I can confirm that it is missing, but when I test the same with local docker image, the file is present. I'm still unsure on how serverless actually deploys the package

I do not want to use psycopg2-binary and I'm still unsure about aws-psycopg2, any suggestions on how to get the code to run?

over 4 years ago · Santiago Trujillo
1 Respuestas
Responde la pregunta

0

You can try using this module instead of default one (Supports only Python3.x)

https://pypi.org/project/aws-psycopg2/

While the above is not actively maintained, and has the max version as psycopg2==2.8.4, it could serve the use-case you might have.

You can also try zipping and uploading the package from here https://github.com/jkehler/awslambda-psycopg2 if you need support for older python versions.

over 4 years ago · Santiago Trujillo Denunciar
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda