Giter Site home page Giter Site logo

klayers's Introduction

Keith's Layers (Klayers)

🐍 A collection of Python Packages as AWS Lambda(λ) Layers 🐍

Python 3.10 Python 3.11 Python 3.12 Code style: black

List of ARNs

List of the latest layer version arns are available by region:

Note: We have deprecated layers for python3.6, python3.7, python 3.8 and python3.9, Please use the latest version of python (currently python3.12) going forward

Python Packages

For the full list of Python packages, refer to the following, feel free to make a pull requests modifying the files below to requests for a specific package.

Using the Layers

You can use the layers anyway you see fit, and here are 4 options based on what method you use to deploy your lambda functions:

Option 1: Using the Console

Add the arn directly from the console, by selecting Layers->Add a Layer->Specify an Arn:

Screenshot

Option 2: Download copy of layer

Use the Get Layer Version by ARN in python or aws-cli command which will provide an S3 location to download the layer as a zip.

Note: You can only get layers from the specific region your client is configured for, otherwise you'll get a AccessDeniedException error.

Option 3: Using Serverless Framework

You can include layers in your deployments, by utilizing the layers property at the function level, and setting it to the arn of your choice. You must use layers from the same region as your function:

check:
  handler: 02_pipeline/check.main
  description: Checks for package on PyPi via the API
  runtime: python3.9
  timeout: 30
  memorySize: 256
  layers:
  - arn:aws:lambda:${self:provider.region}:113088814899:layer:Klayers-python37-packaging:1
  - arn:aws:lambda:${self:provider.region}:113088814899:layer:Klayers-python38-aws-lambda-powertools:23

Option 4: Using AWS Serverless Application Model (SAM)

Using AWS SAM, you can include layers in your serverless applications.You must use layers from the same region as your function:

ServerlessFunction:
  Type: AWS::Serverless::Function
  Properties:
    CodeUri: .
    Handler: my_handler
    Runtime: Python3.9
    Layers:
        - arn:aws:lambda:ap-southeast-1:113088814899:layer:Klayers-p39-packaging:1

Option 5: Using Terraform with the Klayer provider

Using Terraform, you can use the terraform-provider-klayer. The provider uses the API to enable your functions to always reference the latest layer versions.

terraform {
  required_providers {
    klayers = {
      version = "~> 1.0.0"
      source  = "ldcorentin/klayer"
    }
    aws = {
      source  = "hashicorp/aws"
      version = "~> 3.0"
    }
  }
}

provider "aws" {
  region = "us-east-1"
}

data "klayers_package_latest_version" "pandas" {
  name   = "pandas"
  region = "us-east-1"
}

resource "aws_lambda_function" "test_lambda" {
  filename      = "index.zip"
  function_name = "klayers-test"
  role          = aws_iam_role.iam_for_lambda.arn
  handler       = "index.handler"
  runtime       = "python3.9"
  layers = [
    data.klayers_package_latest_version.pandas.arn
  ]
}

Status of layers

Layers are built with the latest package version at 2am UTC on the first day of the Month.

If there's a critical issue with a package, which needs a new version of it published, raise an issue for the package, and I'll try my best to perform the deploy.

Layer expiry

Some layer versions will have a expiry_date field. This is the date for when the layers will be deleted.

In general, layers are scheduled for deletion 365 days after a new layer version has been published for that package. If you use that latest version of a layer, you're guaranteed at least 365 days before the layer is deleted.

All functions deployed with a layer will still work indefinitely, but you won't be able to deploy new functions referencing a deleted layer version.

Architecture Diagram

Screenshot

API

API v1 has been deprecated. Please use API v2 instead.

All API calls are http-based, and work only with https (TLS1.2 and above). The API is heavily cached, so there could be minor delays in updates.

Get latest ARN for all packages in region

Returns data on the latest layer for a all packages in a specific {region} for your {python_version}. Defaults to json, but both csv and html can be returned as well.

https://api.klayers.cloud/api/v2/{python_version}/layers/latest/{region}/{format}

example:

Get all ARNs for specific package in region

Returns data on the all layers (latest and deprecated) for a specific {package} in a specific {region} for your {python_version}

https://api.klayers.cloud/api/v2/{python_version}/layers/{region}/{package}

example:

Special Thanks

Asking for additional layers

If you would like a new package to be made a layer, raise a pull request modifying the pipeline/config/packages_p310.csv or pipeline/config/packages_p310-arm64.csv file (depending on which architecture you prefer). By default, please request for the latest version of python unless you absolutely need an older version.

Consider Making a Donation

If you've found Klayers helpful, consider making a small donation here.

klayers's People

Contributors

ad1cted avatar adriaanbd avatar adriangn avatar ajaykarpur avatar amitdey13 avatar amo-brandon avatar ayushsubedi avatar barthelder avatar david-fortini avatar davinkie avatar dimidd avatar dschmitz89 avatar ernestova avatar gene1wood avatar gesteves91 avatar gowthaman0225 avatar gsanand avatar idealantis avatar iliaaz avatar jenshaase avatar jonnokc avatar keithrozario avatar klayersbot avatar preetigaba avatar raffishquartan avatar ryandeivert avatar sandsy1 avatar sckartoredjo avatar yantraka avatar zvanderbilt avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

klayers's Issues

[FEATURE] klayers for psycopg2

Is your feature request related to a problem? Please describe.
Can we please add a klayer for psycopg2 ?

Describe the solution you'd like
Region - us-west-2
Python version - 3.6

Additional context
Add any other context or screenshots about the feature request here.

** Additional Packages**:
Only fill this part if you're just requesting an additional package

[BUG] PyYAML doesn't list Python 3.8 as a compatible runtime

Describe the bug
The current version of the PyYAML layer doesn't report Python 3.8 as a compatible version, despite being built for it. (This was true of the regions I checked: us-, ca-)

Screenshots

aws lambda get-layer-version-by-arn --arn arn:aws:lambda:us-west-2:770693421928:layer:Klayers-python38-PyYAML:3
{
    "Content": {
        "Location": "https://awslambda-...df",
        "CodeSha256": "gYVoWVlhcAYOej80J1Cxo23o20fRaBufPBBZ1vN5tHI=",
        "CodeSize": 103715
    },
    "LayerArn": "arn:aws:lambda:us-west-2:770693421928:layer:Klayers-python38-PyYAML",
    "LayerVersionArn": "arn:aws:lambda:us-west-2:770693421928:layer:Klayers-python38-PyYAML:3",
    "Description": "PyYAML==5.3.1 | 55dae5eec93bd08d60198103ea73ca1f32d48d91269e80b2487fe279b838f329",
    "CreatedDate": "2020-03-23T02:00:38.261+0000",
    "Version": 3,
    "CompatibleRuntimes": [
        "python3.6",
        "python3.7"
    ],
    "LicenseInfo": "MIT"
}

Note that CompatibleRuntimes lists Python 3.6 and 3.7, but not Python 3.8.

Layer Version ARN:
Probably all of the PyYAML ARNs, but these were the ones I checked:

arn:aws:lambda:ca-central-1:770693421928:layer:Klayers-python38-PyYAML:3
arn:aws:lambda:us-east-1:770693421928:layer:Klayers-python38-PyYAML:3
arn:aws:lambda:us-east-2:770693421928:layer:Klayers-python38-PyYAML:3
arn:aws:lambda:us-west-1:770693421928:layer:Klayers-python38-PyYAML:3
arn:aws:lambda:us-west-2:770693421928:layer:Klayers-python38-PyYAML:3

Framework:
Terraform and raw Python.

Additional context
Downloading the ZIP file and re-uploading it to my account, tagging it with Python 3.8, and running it seems to work fine.

It doesn't seem to be a shortcut link, a Python package or a valid path to a data directory.

First of all, thank you so much for creating one of the most useful repos. Your time and work is highly appreciated.

Coming to the issue,
I am trying to use the latest Spacy 2.2.3 using the ARN provided-

{
        "package_version": "2.2.3",
        "package": "spacy",
        "layer_version_arn": "arn:aws:lambda:us-west-2:113088814899:layer:Klayers-python37-spacy:13",
        "deployed_region": "us-west-2"
    }

I am getting the following error-

[ERROR] OSError: [E050] Can't find model '/opt/en_core_web_sm-2.2.3'. It doesn't seem to be a shortcut link, a Python package or a valid path to a data directory.
Traceback (most recent call last):
  File "/var/task/lambda_function.py", line 5, in lambda_handler
    nlp = spacy.load('/opt/en_core_web_sm-2.2.3')
  File "/opt/python/spacy/__init__.py", line 30, in load
    return util.load_model(name, **overrides)
  File "/opt/python/spacy/util.py", line 169, in load_model
    raise IOError(Errors.E050.format(name=name))

I did read your comment in another issue-

There’s two options, the best would be to download the model, zip it up into a layer and include that layer in your function. You can then load the model via spacy.load(‘/opt/model_name’)

I am having tough times getting this to work. I referred to this blog but by using the latest ARN, but, it doesn't work. What I mean is, when I create a layer out of the model, it still throws the above error.

You have suggested to package the model as a layer, please can you give more information on it? How do we do it? Is there a layer for the model already? I checked the json, its not available.

Basically I have downloaded the en_core_web_sm-2.2.5.tar.gz from here, how do I get this to a layer in lambda so that I can access the lambda from /opt/en_core_web_sm-2.2.5

Any advice or assistance will be highly appreciated. I can write a brief documentation of the solution which can eventually help lot more people.

[FEATURE] Add Datadog SDK

Is your feature request related to a problem? Please describe.
A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]
Add new package datadog. This is a python SDK for interacting with datadog api's. This is different to the existing https://github.com/DataDog/datadog-lambda-python which collects metrics about lambda functions.

Describe the solution you'd like
A clear and concise description of what you want to happen.

Additional context
Add any other context or screenshots about the feature request here.

** Additional Packages**:
Only fill this part if you're just requesting an additional package

Create new lambda layer for pytz

I was wondering if you'd be willing to create a public layer for pytz. As it's not included in lambda and datetime sucks at dealing with timezones...

Pytz layer permissions seem to be incorrect

It appears that there's an issue with the permissions on the pytz layer.

I'm using Terraform to deploy functions and it appears to be attempting to get the layer versions by arn. This works fine on your boto3 layer but on the pytz layer it gets Access Denied.

I've tested in us-east-1, ap-southeast-1 and ap-southeast-2 and get identical results.

pytz:
Test Command:
aws lambda get-layer-version-by-arn --arn arn:aws:lambda:ap-southeast-2:113088814899:layer:Klayers-python37-ptyz:1 --region ap-southeast-2
Result:
Access denied

boto3:
Test Command:
aws lambda get-layer-version-by-arn --arn arn:aws:lambda:ap-southeast-2:113088814899:layer:Klayers-python37-boto3:2 --region ap-southeast-2
Result:
Success

[BUG] Unable to list-layer-versions against ARN

Describe the bug
Unable to list-layer-versions against layer arn arn:aws:lambda:eu-west-1:113088814899:layer:Klayers-python37-requests

Screenshots

aws --region eu-west-1 lambda list-layer-versions --layer-name arn:aws:lambda:eu-west-1:113088814899:layer:Klayers-python37-requests                          

An error occurred (AccessDeniedException) when calling the ListLayerVersions operation: User: REDACTED is not authorized to perform: lambda:ListLayerVersions on resource: arn:aws:lambda:eu-west-1:113088814899:layer:Klayers-python37-requests

Layer Version ARN:
arn:aws:lambda:eu-west-1:113088814899:layer:Klayers-python37-requests

Framework:
AWS CLI

Additional context
In order for our lambdas to pull the latest version of a layer, we list out all layer versions and retrieve the most recent one. We do this because we have no means of finding what is the latest one. This functionality was available in the past but looks like it is no longer available.

Appreciate the help on this.

Request: langdetect and translate

Additional Packages:

  1. The library detectlang is useful to detect the language of a text, to be able to use a correct spacy model, or to be able to translate the text from one language to another. The tar file can be found here and the pypi page here.

  2. The library translate is self-explanatory. The pypi page is here and the tar file is over here.

These two libraries are great add-ons and complement to the spacy and pytesseract layers already provided.

Thanks a lot for your time, if I can do anything to help out, let me know!

[FEATURE] Creating new layers.

Is your feature request related to a problem? Please describe.
Would be great if there was some documentation on how to contribute new layers.

Describe the solution you'd like
A documentation of how to navigate the project and or create new layers.

Request: pyodbc

Hi

Please could you kindly add pyodbc to your collection?

SpaCy ARN - Validation error due to Regular Expression

Describe the bug
When deploying a SpaCy and SpaCy model Lambda Layer with CloudFormation, there's a validation error for regular expression pattern.

    SpaCyLayer:
        Type: AWS::Lambda::LayerVersion
        Properties:
            Description: SpaCy module
            LayerName: !Sub arn:aws:lambda:${AWS::Region}:770693421928:layer:Klayers-python38-spacy:24

    SpaCyEngModel:
        Type: AWS::Lambda::LayerVersion
        Properties:
            Description: Small english model for SpaCy
            LayerName: !Sub arn:aws:lambda:${AWS::Region}:770693421928:layer:Klayers-python38-spacy_model_en_small:1

Screenshots
image

Layer Version ARN:
arn:aws:lambda:us-east-1:770693421928:layer:Klayers-python38-spacy:24
arn:aws:lambda:us-east-1:770693421928:layer:Klayers-python38-spacy_model_en_small:1

Framework:
AWS CLI with CloudFormation

Additional context
This is executed with aws cloudformation package then aws cloudformation deploy due to local file path in another part of the script.

[BUG] It doesn't seem to be a shortcut link, a Python package or a valid path to a data directory.

Describe the bug

I would like to use the Spacy layer, but it's not working. The following code:

nlp = spacy.load('/opt/en_core_web_sm-2.2.5')

Raises the following error: It doesn't seem to be a shortcut link, a Python package or a valid path to a data directory. I've listed what is inside the /opt directory, and there are only python dependencies within the python/ directory.

I have tried to use the layer for both Python37 and Python38.

Layer Version ARN:

arn:aws:lambda:us-east-1:113088814899:layer:Klayers-python37-spacy:18
arn:aws:lambda:us-east-1:770693421928:layer:Klayers-python38-spacy:11

Specific Layer ARN that didn't work (let's us know which version, region etc).

Framework:

Serverless Framework

[FEATURE] Add pyarrow layer

Need pyarrow to work w/parquet data in lambda

** Additional Packages**:
Only fill this part if you're just requesting an additional package

[FEATURE] Can you please add a layer for mpld3?

Is your feature request related to a problem? Please describe.
Can you add a layer for mpld3?

Describe the solution you'd like
A clear and concise description of what you want to happen.

Additional context
Add any other context or screenshots about the feature request here.

** Additional Packages**:
mpld3

[FEATURE] What's the process for requesting new layers?

Is creating a feature request for new layers the best way to have items added to Klayers? Is there anything the community can do to help in terms of a pull request to make things easier on Klayers maintainers? I glanced at CONTRIBUTING.md but didn't see anything specific.

I'd like to request a layer for gtfs-realtime-bindings:

[BUG] cannot import name '_imaging' from 'PIL'

Describe the bug

I cant seem to get away from this error message. I'm having this error on my own layers which was the reason i was trying yours but i see the same error message. Can you give me guidance on this. Im not sure if there is a layer issue or a gap in my understanding?

[ERROR] ImportError: cannot import name '_imaging' from 'PIL' (/var/task/PIL/__init__.py)
Traceback (most recent call last):
  File "/var/task/src/event-processing/process-fax.py", line 210, in ocr_handler
    from PIL import Image
  File "/var/task/PIL/Image.py", line 69, in <module>
    from . import _imaging as core

Layer Version ARN:
I have tried using arn:aws:lambda:us-east-1:770693421928:layer:Klayers-python38-Pillow:2 in combo with my code to get Pillow.

Then i tried to just use your tesseract layer to remove my layers from the picture. arn:aws:lambda:us-east-1:113088814899:layer:Klayers-python37-tesseract:1 From the stack trace i can see that PIL is found so this feels like its a OS level issue which is seemingly what i have been chasing for some time now. I was hoping the use of the layer would fix that and was the intended purpose of the layer.

Framework:
Serverless

Help?

No more spaCy?

Hey,

These look great. I came here from your blog post looking for the spaCy layer, looks as if you removed it — any particular reason why?

Initial Update

The bot created this issue to inform you that pyup.io has been set up on this repo.
Once you have closed it, the bot will open pull requests for updates as soon as they are available.

Spacy layer ?

Hi,

I saw that you've recently removed the spacy layer. Are you by chance aware of any alternatives?

thanks a lot

No module named 'numpy.core._multiarray_umath'

With arn:aws:lambda:us-west-2:113088814899:layer:Klayers-python37-numpy:1, I'm getting an error.

START RequestId: XXXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX Version: $LATEST
Unable to import module 'lambda_function': 

IMPORTANT: PLEASE READ THIS FOR ADVICE ON HOW TO SOLVE THIS ISSUE!

Importing the numpy c-extensions failed.
- Try uninstalling and reinstalling numpy.
- If you have already done that, then:
  1. Check that you expected to use Python3.6 from "/var/lang/bin/python3.6",
     and that you have no directories in your PATH or PYTHONPATH that can
     interfere with the Python and numpy version "1.17.0" you're trying to use.
  2. If (1) looks fine, you can open a new issue at
     https://github.com/numpy/numpy/issues.  Please include details on:
     - how you installed Python
     - how you installed numpy
     - your operating system
     - whether or not you have multiple versions of Python installed
     - if you built from source, your compiler versions and ideally a build log

- If you're working with a numpy git repository, try `git clean -xdf`
  (removes all files not under version control) and rebuild numpy.

Note: this error has many possible causes, so please don't comment on
an existing issue about this - open a new one instead.

Original error was: No module named 'numpy.core._multiarray_umath'


END RequestId: XXXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX
REPORT RequestId: XXXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX	Duration: 0.38 ms	Billed Duration: 100 ms 	Memory Size: 128 MB	Max Memory Used: 51 MB	

The following code should reproduce the error.

import json
import numpy


def lambda_handler(event, context):
    # TODO implement
    return {
        'statusCode': 200,
        'body': json.dumps('Hello from Lambda!')
    }

Scikit-learn

** Additional Packages**:
I would like to request the adding of a scikit-learn layer as it is the main general purpose machine learning library

[BUG] OpenCV Headless doesn't work with lambda

Describe the bug
OpenCV Headless isn't working with Lambda Layers. Getting an error:

{
  "errorMessage": "Unable to import module 'lambda_function': libgthread-2.0.so.0: cannot open shared object file: No such file or directory",
  "errorType": "Runtime.ImportModuleError"
}

Lambda function:

import json
import cv2

def lambda_handler(event, context):
    # TODO implement
    return {
        'statusCode': 200,
        'body': json.dumps('Hello from Lambda!')
    }

Layer Version ARN:
arn:aws:lambda:eu-west-2:770693421928:layer:Klayers-python38-opencv-python-headless:11

Framework:
Console

[BUG] New package builds seem to miss out 'package' name in API

Describe the bug
In the builds api, newer packages like geopy and shapely seem to be missing the 'package' attribute.

Framework:
N/A

Additional context
I did manually trigger the SF to generate them, rather than having the weekly job do it. Perhaps some issue with manual triggering. The latest/package api works just fine.

[BUG]

Describe the bug

I am getting the following error:

{
"errorMessage": "[E050] Can't find model 'en_core_web_sm'. It doesn't seem to be a shortcut link, a Python package or a valid path to a data directory.",
"errorType": "OSError",
"stackTrace": [
" File "/var/lang/lib/python3.7/imp.py", line 234, in load_module\n return load_source(name, filename, file)\n",
" File "/var/lang/lib/python3.7/imp.py", line 171, in load_source\n module = _load(spec)\n",
" File "", line 696, in _load\n",
" File "", line 677, in _load_unlocked\n",
" File "", line 728, in exec_module\n",
" File "", line 219, in _call_with_frames_removed\n",
" File "/var/task/handler.py", line 23, in \n nlp = spacy.load('en_core_web_sm')\n",
" File "/opt/python/spacy/init.py", line 30, in load\n return util.load_model(name, **overrides)\n",
" File "/opt/python/spacy/util.py", line 169, in load_model\n raise IOError(Errors.E050.format(name=name))\n"
]
}

Screenshots
If applicable, add screenshots to help explain your problem.

Layer Version ARN:
Specific Layer ARN that didn't work (let's us know which version, region etc).

  • arn:aws:lambda:ap-southeast-1:113088814899:layer:Klayers-python37-spacy:9

Framework:
What Framework do you use (Serverless, Architect, Zappa, or just Console?)
Serverless

Additional context
Add any other context about the problem here.

I am using it as below:

import spacy
nlp = spacy.load('en_core_web_sm')

tesseract:2 layer not found

I tried to include the tesseract:2 layer in one of my chalice apps and got such an error when I tried to deploy it:

An error occurred (AccessDeniedException) when calling the
 UpdateFunctionConfiguration operation: User:
 arn:aws:iam::my_aws_user is not authorized to perform:
 lambda:GetLayerVersion on resource: arn:aws:lambda:us-
 east-1:113088814899:layer:Klayers--tesseract:2

tesseract:1 layer works though.

[FEATURE] Please add crhelper as a layer

Is your feature request related to a problem? Please describe.
Please create a layer https://github.com/aws-cloudformation/custom-resource-helper. This is used to help write custom cloudformation resources.

Describe the solution you'd like
A clear and concise description of what you want to happen.

Additional context
Add any other context or screenshots about the feature request here.

** Additional Packages**:
https://github.com/aws-cloudformation/custom-resource-helper

[FEATURE]

Would it be possible to build a layer for Matplotlib as well? It would be great to have an ARN to use in Lambda.

[BUG] Layer does not exist

Describe the bug
Trying to add a layer to a Lambda via AWS, I get Layer version does not exist

Layer version arn:aws:lambda:us-east-1:113088814899:layer:Klayers-python37-opencv-python-headless:5 does not exist.

Screenshots
Screen Shot 2019-12-29 at 1 03 47 PM

Layer Version ARN:
I was previously using
arn:aws:lambda:us-east-1:113088814899:layer:Klayers-python37-opencv-python-headless:4 successfully.
Now for version 4 I get Layer version does not exist, so I tried upgrading to version 5, same problem.
Layer version arn:aws:lambda:us-east-1:113088814899:layer:Klayers-python37-opencv-python-headless:5 does not exist.

Framework:
None, adding layers via AWS Lambda GUI

[BUG] Using pandas ARN is giving this error - [ERROR] ImportError: Missing optional dependency 'fsspec'. Use pip or conda to install fsspec.

Describe the bug
I am using pandas ARN but seeing this error -

[ERROR] ImportError: Missing optional dependency 'fsspec'. Use pip or conda to install fsspec.

I am using pd.read_csv in my code which gives me this error.

Layer Version ARN:

arn:aws:lambda:us-west-2:770693421928:layer:Klayers-python38-pandas:19

Framework:
Serverless

Any inputs would be of great help. Thanks!

[FEATURE] Can you please add a layer for pyodbc and cxOracle ?

pyODBC is generally very useful to deal with accessing ODBC databases whereas cx_Oracle is a Python extension module that enables access to Oracle Datable and will help me get going with new modules . Thatll make things much simpler for us lambda users

Spacy Layer: Error while loading spacy.load("en")

I added the Spacy layer to my lambda function.
- arn:aws:lambda:ap-southeast-1:113088814899:layer:Klayers-python37-spacy:2

It works fine when i import the spacy library
import spacy
But i get errors while i try to load the "en" or "en_core_web_sm" packages.


nlp = spacy.load("en")
# nlp = spacy.load('en_core_web_sm')
# nlp = spacy.load('en_core_web_md')

Error while loading scpay packages:


{
    "errorMessage": "[E050] Can't find model 'en'. It doesn't seem to be a shortcut link, a Python package or a valid path to a data directory.",
    "errorType": "OSError",
    "stackTrace": [
        "  File \"/var/lang/lib/python3.7/imp.py\", line 234, in load_module\n    return load_source(name, filename, file)\n",
        "  File \"/var/lang/lib/python3.7/imp.py\", line 171, in load_source\n    module = _load(spec)\n",
        "  File \"<frozen importlib._bootstrap>\", line 696, in _load\n",
        "  File \"<frozen importlib._bootstrap>\", line 677, in _load_unlocked\n",
        "  File \"<frozen importlib._bootstrap_external>\", line 728, in exec_module\n",
        "  File \"<frozen importlib._bootstrap>\", line 219, in _call_with_frames_removed\n",
        "  File \"/var/task/handler.py\", line 30, in <module>\n    nlp = spacy.load(\"en\")\n",
        "  File \"/opt/python/spacy/__init__.py\", line 27, in load\n    return util.load_model(name, **overrides)\n",
        "  File \"/opt/python/spacy/util.py\", line 171, in load_model\n    raise IOError(Errors.E050.format(name=name))\n"
    ]
}

Please provide some working example.

Thanks
Biranchi

[FEATURE] Could you add a layer for urllib2?

Is your feature request related to a problem? Please describe.
A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]

Describe the solution you'd like
A clear and concise description of what you want to happen.

Additional context
Add any other context or screenshots about the feature request here.

** Additional Packages**:
Only fill this part if you're just requesting an additional package

Add lxml [FEATURE]

It would be really helpful to have a ready-to-go arn for lxml - is this something that is available via one of the existing packages? Thank you.

[BUG] Does not download a ZIP but a binary file

Describe the bug
Was hoping to get the ZIP of all of the files for this layer.

I am trying to get the zip for the Pillow library at this arn:
arn:aws:lambda:us-east-1:770693421928:layer:Klayers-python38-Pillow:5

However, instead of downloading the files in a ZIP I just get a single binary text file

Layer Version ARN:
This is the arn: arn:aws:lambda:us-east-1:770693421928:layer:Klayers-python38-Pillow:5

and the command I use to get it, in bash in Terminal on mac:
aws lambda get-layer-version-by-arn --arn arn:aws:lambda:us-east-1:770693421928:layer:Klayers-python38-Pillow:5

[BUG] Permissions Issue on us-east-1:113088814899:layer:Klayers-python37-requests:11

Describe the bug
This is the error I am getting when adding this layer to my stack:

is not authorized to perform: lambda:GetLayerVersion on resource: arn:aws:lambda:us-east-1:113088814899:layer:Klayers-python37-requests:11 (Service: AWSLambdaInternal; Status Code: 403; Error Code: AccessDeniedException; Request ID: 4e95f805-f987-4028-998b-33d7f47253c0)

Layer Version ARN:
arn:aws:lambda:us-east-1:113088814899:layer:Klayers-python37-requests:11

Framework:
I call it Serverless-ish because I'm deploying the template and updating the Lambda code via a BitBucket pipeline.

Additional context
Possibly related to this: theam/aws-lambda-haskell-runtime#1

Create new lambda layer for latest version of boto3

The version of boto3 included with Lambda functions is horribly out of date (boto3-1.9.42 for python3.7 runtimes) and I hate having to package boto3 every time I make a new function.

I have used your package.sh script to create lambda layers in my account for boto3 and it worked great! However, I would love to have a public lambda layer that I can reference from any account.

Please publish a public lambda layer for boto3!! Would be super appreciated

[FEATURE]ReportLab-Integration

Is your feature request related to a problem? Please describe.
I am reading that many people (including me) have problems to run ReportLab to create PDF's on AWSLambda. ReportLab interacts with Pillow and makes a lot of problems inside the Lambda-Environment

Describe the solution you'd like
Integration of the ReportLab-package

pysftp

Could you please add pysftp ?

bcrypt==3.2.0
cffi==1.14.3
cryptography==3.2.1
paramiko==2.7.2
pycairo==1.20.0
pycparser==2.20
PyGObject==3.38.0
PyNaCl==1.4.0
pysftp==0.2.9
six==1.15.0

TesseractNotFoundError for Python 3.7

I am trying to create a Lambda function by using the Pytesseract library for Python 3.7. I also put the Tesseract binaries at the same location.

Tesseract works fine when calling it using the subprocess library. But pytesseract.image_to_string(image_string) gives TesseractNotFoundError.

I tried to set the LD_LIBRARY_PATH and TESSDATA_PREFIX both in the script, but that does not make any difference.

Any help will be appreciated! Thanks!

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.