aws-psycopg2 icon indicating copy to clipboard operation
aws-psycopg2 copied to clipboard

AWS lambda 3.9 import failed error

Open pguinard-public-com opened this issue 2 years ago • 1 comments

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

pguinard-public-com avatar Aug 01 '22 17:08 pguinard-public-com

hey @pguinard-public-com

try to uninstall & install

pip uninstall -y aws-psycopg2

pip install aws-psycopg2==1.3.8 -U

AbhimanyuHK avatar Feb 05 '23 12:02 AbhimanyuHK