Search code examples
serverless

Serverless deploy error - unable to find image locally


I am following this tutorial on using python packages with Serverless. Everything was working until I went to deploy with serverless-deploy. Then I got the below error. Does anyone know how to remedy this?

Other info:

  • OS: Windows 10
  • WLS Distro: 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.

Solution

  • From Pypi, numpy==1.21.2 requires at python version to be Python >=3.7, <3.11.

    You should either upgrade your lambda image to lambci/lambda:build-python3.8 or downgrade the version of numpy to numpy==1.19.5 which supports python3.6.