Serverless-python-requirements: Unzipped size must be smaller than 262144000 bytes

Created on 11 Apr 2019  路  1Comment  路  Source: UnitedIncome/serverless-python-requirements

This error occurs on sls deploy. I think it should work with zip: true. Code shared below

serverless.yml


service: test-big-libs 

provider:
  name: aws
  runtime: python3.6
  stage: ${opt:stage,'dev'}

custom:
  pythonRequirements:
    dockerizePip: true
    zip: true
    slim: true

hander.py


try:
  import unzip_requirements
except ImportError:
  pass

import numpy as np
import scipy as sc
import sklearn as sk 
import joblib 
import pandas as pd


import json


def test(event, context):
    body = {
        "message": "big libs works"
    }

    response = {
        "statusCode": 200,
        "body": json.dumps(body)
    }

    return response

requirements.txt

joblib==0.13.2
numpy==1.16.2
pandas==0.24.2
python-dateutil==2.8.0
pytz==2019.1
scikit-learn==0.20.3
scipy==1.2.1
six==1.12.0
sklearn==0.0

Most helpful comment

this solves my problem


package:
  exclude:
    - node_modules/**
    - venv/**

>All comments

this solves my problem


package:
  exclude:
    - node_modules/**
    - venv/**

Was this page helpful?
0 / 5 - 0 ratings

Related issues

simplesteph picture simplesteph  路  5Comments

calclavia picture calclavia  路  5Comments

IanTayler picture IanTayler  路  4Comments

miketheman picture miketheman  路  3Comments

JulienMarliac picture JulienMarliac  路  3Comments