我正在运行带有运行时的AWS Lambda脚本Python 2.7.但是,无论何时初始化它都会开始导入grequests库但由于它依赖于gevent而失败:
Gevent is required for grequests.
它似乎成功找到了grequests库(因为它知道它需要gevent)但是失败了.
到目前为止我尝试过的:
pip install --ignore-installed grequests -t .
pip install --ignore-installed grequests -t ./lib
pip install --ignore-installed gevent -t .
pip install --ignore-installed gevent -t ./lib
然后我按照以下说明压缩目录的内容并上传到AWS:http://docs.aws.amazon.com/lambda/latest/dg/lambda-python-how-to-create-deployment-package. HTML
似乎无论我尝试Lambda无法定位gevent,但它能够找到其他非默认库没有问题.
我有一个 HTTP 代理端点,经过测试后可以正常工作:
Request: /results?auth=abc123&id=9876&start=2016-08-20&end=2016-09-01
Status: 200
Latency: 265 ms
Run Code Online (Sandbox Code Playgroud)
当通过 Postman 定位时返回以下内容:
<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0//EN">
<html>
<head>
<title>400 Bad Request</title>
</head>
<body>
<h1>Bad Request</h1>
<p>Your browser sent a request that this server could not understand.
<br />
</p>
</body>
</html>
Run Code Online (Sandbox Code Playgroud)
端点设置如下(一些信息已编辑):
没有身份验证或授权设置(它是直接传递查询参数)。