AbhimanyuHK / aws-psycopg2

A aws psycopg2 package from psycopg2 https://pypi.org/project/aws-psycopg2/
75 stars 11 forks source link

AWS lambda 3.9 import failed error #12

Open pguinard-public-com opened 2 years ago

pguinard-public-com commented 2 years ago

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
AbhimanyuHK commented 1 year ago

hey @pguinard-public-com

try to uninstall & install

pip uninstall -y aws-psycopg2

pip install aws-psycopg2==1.3.8 -U