Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

AWS lambda 3.9 import failed error #12

Open
pguinard-public-com opened this issue Aug 1, 2022 · 1 comment
Open

AWS lambda 3.9 import failed error #12

pguinard-public-com opened this issue Aug 1, 2022 · 1 comment

Comments

@pguinard-public-com
Copy link

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 pguinard-public-com changed the title AWS lambda 3.9 error AWS lambda 3.9 import failed error Aug 1, 2022
@AbhimanyuHK
Copy link
Owner

hey @pguinard-public-com

try to uninstall & install

pip uninstall -y aws-psycopg2

pip install aws-psycopg2==1.3.8 -U

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants