Home:ALL Converter>sqlalchemy Lambda module import error

sqlalchemy Lambda module import error

Ask Time:2017-11-07T21:34:11         Author:Prabhu Khanna Mahadevan

Json Formatter

I am trying to connect my redshift database from AWS Lambda function. I am getting below error when I try to achieve the connection.

Unable to import module 'lambda_function': No module named 'sqlalchemy'

Below is the import code that I am using in my lambda. I have tried all possible import function. Still noting works. Results in the same error.

from __future__ import print_function

import sqlalchemy as sa
from sqlalchemy.orm import sessionmaker

from flask_sqlalchemy import SQLAlchemy

from flask.ext.sqlalchemy import SQLAlchemy as sa

from flask_sqlalchemy import SQLAlchemy
from sqlalchemy import *
from sqlalchemy.ext.declarative import declarative_base
from sqlalchemy import Column, String
from sqlalchemy.orm import sessionmaker

Author:Prabhu Khanna Mahadevan,eproduced under the CC 4.0 BY-SA copyright license with a link to the original source and this disclaimer.
Link to original article:https://stackoverflow.com/questions/47159307/sqlalchemy-lambda-module-import-error
Vijayanath Viswanathan :

As 'sqlalchemy' is not a part of AWS SDK you should include it in your deployment package. If you are deploying it as a .zip file then make sure you have included it in the zip",
2017-11-07T14:16:06
yy