【问题标题】:Serverless deploy error - unable to find image locally无服务器部署错误 - 无法在本地找到图像
【发布时间】:2021-09-15 20:44:25
【问题描述】:

我正在关注this 使用无服务器 Python 包的教程。在我使用serverless-deploy 进行部署之前,一切正常。然后我得到了以下错误。有谁知道如何解决这个问题?

其他信息:

  • 操作系统:Windows 10
  • WLS 发行版:Ubuntu v2
Serverless: Generated requirements from C:\Users\path-to-project\numpy-test\requirements.txt in C:\Users\path-to-project\numpy-test\.serverless\requirements.txt...
Serverless: Installing requirements from C:\Users\myname\AppData\Local\UnitedIncome\serverless-python-requirements\Cache\e1e710a0b480eb4e7e39fca7f1ff66fff4b6f5d572ded1d71d5082f9afe1de06_slspyc\requirements.txt ...
Serverless: Docker Image: lambci/lambda:build-python3.6
Serverless: Using download cache directory C:\Users\myname\AppData\Local\UnitedIncome\serverless-python-requirements\Cache\downloadCacheslspyc
Serverless: Running docker run --rm -v C\:/Users/myname/AppData/Local/UnitedIncome/serverless-python-requirements/Cache/e1e710a0b480eb4e7e39fca7f1ff66fff4b6f5d572ded1d71d5082f9afe1de06_slspyc\:/var/task\:z -v C\:/Users/myname/AppData/Local/UnitedIncome/serverless-python-requirements/Cache/downloadCacheslspyc\:/var/useDownloadCache\:z -u 0 lambci/lambda\:build-python3.6 python -m pip install -t /var/task/ -r /var/task/requirements.txt --cache-dir /var/useDownloadCache...

 Error ---------------------------------------------------

  Error: STDOUT:

  STDERR: Unable to find image 'lambci/lambda:build-python3.6' locally
  build-python3.6: Pulling from lambci/lambda
  832a9fa6947e: Pulling fs layer
  fe6bfd165af8: Pulling fs layer
  c61e272c0488: Pulling fs layer
  7022c87fa044: Pulling fs layer
  ab51495a619c: Pulling fs layer
  28e9e78ca9d3: Pulling fs layer
  6b8ec334143c: Pulling fs layer
  7022c87fa044: Waiting
  6b8ec334143c: Waiting
  ab51495a619c: Waiting
  28e9e78ca9d3: Waiting
  c61e272c0488: Verifying Checksum
  c61e272c0488: Download complete
  7022c87fa044: Verifying Checksum
  7022c87fa044: Download complete
  ab51495a619c: Verifying Checksum
  ab51495a619c: Download complete
  28e9e78ca9d3: Download complete
  6b8ec334143c: Download complete
  832a9fa6947e: Verifying Checksum
  832a9fa6947e: Download complete
  fe6bfd165af8: Download complete
  832a9fa6947e: Pull complete
  fe6bfd165af8: Pull complete
  c61e272c0488: Pull complete
  7022c87fa044: Pull complete
  ab51495a619c: Pull complete
  28e9e78ca9d3: Pull complete
  6b8ec334143c: Pull complete
  Digest: sha256:9b1cea555bfed62d1fc9e9130efa9842ee144ef02e2a6a266f1c9e6adeb0866f
  Status: Downloaded newer image for lambci/lambda:build-python3.6
  ERROR: Could not find a version that satisfies the requirement numpy==1.21.2
  ERROR: No matching distribution found for numpy==1.21.2
  WARNING: You are using pip version 21.0; however, version 21.2.4 is available.
  You should consider upgrading via the '/var/lang/bin/python -m pip install --upgrade pip' command.

【问题讨论】:

  • 它在哪个版本的 python 中工作?
  • python3.6指定的yml文件

标签: serverless


【解决方案1】:

来自Pypinumpy==1.21.2 要求在 python 版本为Python >=3.7, <3.11

您应该将您的 lambda 映像升级到 lambci/lambda:build-python3.8 或将 numpy 的版本降级到支持 python3.6numpy==1.19.5

【讨论】:

  • 谢谢,我现在正在重试,但在进入上述错误之前又遇到了另一个错误。在Serverless: Docker Image: lambci/lambda:build-python3.6 之后,我收到错误Error: error during connect: This error may indicate that the docker daemon is not running。现在研究一下,谢谢
猜你喜欢
  • 1970-01-01
  • 1970-01-01
  • 2018-12-22
  • 2020-05-09
  • 1970-01-01
  • 2019-01-02
  • 1970-01-01
  • 1970-01-01
  • 2020-01-28
相关资源
最近更新 更多