问题描述
我创建了一个lambda函数,该函数将数据上传到雪花.我在文件夹中安装了所有要求,并与我的主要python文件一起压缩.在AWS中运行时会显示错误:
I created a lambda function which upload data to snowflake. I installed a all requirements in folder and zipped along with my main python file. While running in AWS it shows an error:
但是我在指定的路径上有这个模块.我不知道为什么它显示错误.我不知道为什么会出现错误.
But I have this module at specified path. I don't know why it shows an error. I don't know why the error is arise.
这是代码:
main(event, context):
import snowflake.connector
cnx = snowflake.connector.connect( user='xxx', password='yyyyy', account='zzzz', database="db Name", schema = "schema Name" )
try:
query = "SELECT * FROM Table_Name"
cnx.cursor().execute(query)
finally:
cnx.close()
推荐答案
我最近遇到了同样的问题,发现这是Windows环境的问题,尝试创建linux环境,安装Python,程序包,并使用所有库压缩您的代码,然后放回AWS lambda,希望它能工作.
I faced same issue recently and found it is a problem with windows environment, try to create linux environment, install Python, packages, zip your code with all libraries and then throw back to AWS lambda, hopefully it will work.
这篇关于Lambda错误:找不到模块.密码学.hamtaz.bindings._constant_time的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!