How to install pymysql on AWS lambda

后端 未结 3 970
名媛妹妹
名媛妹妹 2020-12-31 10:11

I\'ve looked here and here as I\'ve been trying to work out how to get pymysql running on AWS lambda. The examples I\'ve looked at so far are extremely complex,

3条回答
  •  臣服心动
    2020-12-31 10:56

    I was facing similar problem with Redis python library. I follow the same documentation instructions which you mentioned in your second link.

    here is example snippet for your reference :

    Create new directory MyPythonLambda and put MyPythonLambda.py in the same.

    Assume MyPythonLambda/MyPythonLambda.py is main lambda containing handler.

     cd MyPythonLambda/
     pip install redis -t .
     zip -r MyPythonLambda.zip *
    

    Upload/import zip in lambda creation from S3 or your local file system.

    I think you need to create zip file in similar way containing your python mysql library.

提交回复
热议问题