aws-psycopg2
aws-psycopg2 copied to clipboard
AWS lambda 3.9 import failed error
We're getting the following error after upgrading from python 3.8 to python 3.9.
{ "errorMessage": "Unable to import module 'lambda_function': /var/task/psycopg2/_psycopg.so: undefined symbol: PyUnicodeUCS4_DecodeUTF8", "errorType": "Runtime.ImportModuleError", "requestId": "REMOVED", "stackTrace": [] }
Sample lambda function:
# Copyright 2018 Amazon.com, Inc. or its affiliates. All Rights Reserved.
# SPDX-License-Identifier: MIT-0
import boto3
import json
import logging
import os
import psycopg2
Sample requirements.txt
aws-psycopg2==1.3.8
hey @pguinard-public-com
try to uninstall & install
pip uninstall -y aws-psycopg2
pip install aws-psycopg2==1.3.8 -U