Dev*_*ami 11 python urllib amazon-web-services
我在 aws lambda 上运行 python 脚本,并抛出以下错误。
{
"errorMessage": "Unable to import module 'app': urllib3 v2.0 only supports OpenSSL 1.1.1+, currently the 'ssl' module is compiled with OpenSSL 1.0.2k-fips 26 Jan 2017. See: https://github.com/urllib3/urllib3/issues/2168",
"errorType": "Runtime.ImportModuleError",
"stackTrace": [] }
Run Code Online (Sandbox Code Playgroud)
一小时前它运行得很好,即使我没有进行任何部署,它似乎也失败了。
我的Python版本是3.7。我只使用 urllib 来解析和取消引用 urls 。即
from urllib.parse import urlparse
Run Code Online (Sandbox Code Playgroud)
和
from urllib.parse import unquote
Run Code Online (Sandbox Code Playgroud)
就像 GitHub url 中提到的那样,我可以升级我的 python 版本,但这样做会破坏其他东西。我可以使用任何替代库来获得相同的结果吗?
从 GitHub 链接,它显示 urllib 不再支持 OpenSSL<1.1.1,但不知何故,我们的一些更高环境中相同的脚本运行没有问题。
基于此https://github.com/urllib3/urllib3/issues/2168#issuecomment-1535838106线程在文件中将 my 指定urllib3为 1.26.15修复了此错误。requirement.txt
| 归档时间: |
|
| 查看次数: |
16816 次 |
| 最近记录: |