且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

从AWS Lambda/tmp目录导入python包

更新时间:2021-08-21 07:58:38

在将已下载的任何软件包导入到/tmp 文件夹(例如,导入到/tmp/要求文件夹),则必须告诉系统在那儿查找依赖项.在代码的开头,仅在以下几行:

Before you can import any package that you have downloaded to the /tmp folder (for example to the /tmp/requirements folder) you have to tell the system to look for the dependencies over there. In the beginning of the code, just at these lines:

import sys

sys.path.insert(0, '/tmp/requirements/') # Or any path you desire