Error loading Python dependencies with Serverless Framework for AWS Lambda: Error: STDOUT

Viewed 167

Not able to solve, any help?:

Os: macOS

Docker is running.

The error with "serverless deploy"

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

Error: STDOUT: Collecting numpy==1.21.0 Downloading numpy-1.21.0-cp38-cp38-manylinux_2_12_x86_64.manylinux2010_x86_64.whl (15.7 MB) Installing collected packages: numpy Successfully installed numpy-1.21.0

STDERR: ERROR: Exception: Traceback (most recent call last): File "/var/lang/lib/python3.8/shutil.py", line 788, in move os.rename(src, real_dst) OSError: [Errno 18] Invalid cross-device link: '/tmp/pip-target-0cm4l5vy/lib/python/numpy' -> '/var/task/numpy'

The files: handler.py

import numpy as np
def main(event, context):
  a = np.arange(15).reshape(3, 5)
  print("Your numpy array:")
  print(a)
if __name__ == "__main__":
  main('', '')

serverless.yml

service: harsh-test
frameworkVersion: "2"
provider:
  name: aws
  runtime: python3.8
functions:
  hello:
    handler: handler.main

plugins:
  - serverless-python-requirements

custom:
  pythonRequirements:
    dockerizePip: non-linux

0 Answers
Related