How to Use Libraries in AWS Lambdas - Python Layer Example (Requests)

แชร์
ฝัง
  • เผยแพร่เมื่อ 5 ก.ย. 2024
  • AWS Documentation for Creating a Layer on a AWS Lamda: docs.aws.amazo...
    Terminal Steps:
    mkdir python
    cd python
    pip3 install [library-name-here] -t .
    cd ..
    zip -r python.zip python

ความคิดเห็น • 50

  • @magic175at
    @magic175at 7 วันที่ผ่านมา

    So glad I found this. You explained it very clearly, and I could follow along and get a test layer going in my account. Now to figure out how to automate this ...

  • @felipetmota
    @felipetmota 6 หลายเดือนก่อน +1

    Simple, fast, and shows many tips in the video. Normally I was getting errors after creating the .zip in the windows, not on WSL. Top man!

  • @brittanymorris5326
    @brittanymorris5326 ปีที่แล้ว +1

    Just wanted to send a big thanks for this! I spent two days figuring out why I was getting the import module error. I tried zipping it in different ways and had no luck. I'm new to this so I was stuck. Until I say this video and the comment below pip install requests "urllib3

    • @ImChrisCastro
      @ImChrisCastro  ปีที่แล้ว +1

      Glad to hear you're trying something new and you were able to get unstuck! I'm going to add that command information to the pinned comment. Thank you for the feedback on that, Brittany!

  • @SunilMakkar97
    @SunilMakkar97 หลายเดือนก่อน

    dude its so hard to find a great video on this topic... great job!

  • @ImChrisCastro
    @ImChrisCastro  ปีที่แล้ว +5

    Sorry! My powershell window was very small and probably hard to read lol. Here are the templated commands you want to run for this process, if you are using Python:
    Terminal Steps:
    mkdir python
    cd python
    pip3 install [library-name-here] -t .
    cd ..
    zip -r python.zip python
    ADDITIONALLY, another commenter let me know that the command 'pip install requests "urllib3

  • @purplishjen
    @purplishjen 11 หลายเดือนก่อน

    Finally, a Lambda Layer that works!!! Thank you so much. I have been trying to figure this out the whole day.

  • @SayWhatYouNeedT0Say
    @SayWhatYouNeedT0Say ปีที่แล้ว +1

    You are so funny and smart. I loved your tutorial.

    • @ImChrisCastro
      @ImChrisCastro  ปีที่แล้ว

      Thank you very much, kind stranger!! I appreciate your words :D

  • @user-zh2kb6sx1s
    @user-zh2kb6sx1s 2 หลายเดือนก่อน

    Finally a tutorial that actually works!

  • @matthewshedden6456
    @matthewshedden6456 11 หลายเดือนก่อน

    Thank you very much good sir, all the way from Scotland 🙌

  • @zishanchaudhary221
    @zishanchaudhary221 4 หลายเดือนก่อน

    Thanks Mate! You Saved Me!!!

  • @iago-neres
    @iago-neres ปีที่แล้ว +1

    Thank you Chris. Good video and explanation, straight to the point.

  • @Rayan-rn9wm
    @Rayan-rn9wm 5 หลายเดือนก่อน

    THANK YOU ! , straighforward solution , while stackoverflow and chat gpt gave me headache !

  • @TheOfficialMovmnt
    @TheOfficialMovmnt 4 หลายเดือนก่อน

    You're a life saver! Thank you. You've gained a new subscriber.

  • @async03
    @async03 ปีที่แล้ว +2

    thanks Chris! just an update: it seems like now you need to use pip install requests "urllib3

    • @ImChrisCastro
      @ImChrisCastro  ปีที่แล้ว +1

      Thank you very much for the updated info! Pinning the comment so others may reference it as well!

    • @tanmayapatra3001
      @tanmayapatra3001 ปีที่แล้ว +1

      Bro! love you.... You just fixed my issue. I was trying to fix it since 6 hours. many many thanks.

  • @ErinClayton-xc7pf
    @ErinClayton-xc7pf ปีที่แล้ว

    thank you for this simple video! this was exactly what I needed.

  • @eshaangupta4101
    @eshaangupta4101 ปีที่แล้ว

    Extremely helpful video, thanks!

    • @ImChrisCastro
      @ImChrisCastro  ปีที่แล้ว

      Glad I could be of service, friend!

  • @touficanid8369
    @touficanid8369 ปีที่แล้ว

    Thank you so much !! I needed this urgently !!

  • @danibri
    @danibri ปีที่แล้ว

    Thank you very much Chris, your video helped me a lot, keep it up. Here’s a new follower.

    • @ImChrisCastro
      @ImChrisCastro  ปีที่แล้ว

      Thank you very very much! That means a lot to me.

  • @malwaredev33
    @malwaredev33 ปีที่แล้ว

    awesome video. Thank you for this simple video! this was exactly what I needed. Bro

  • @sheharyaar6338
    @sheharyaar6338 ปีที่แล้ว

    thank you so much really great job and it was really helpful for me

    • @ImChrisCastro
      @ImChrisCastro  ปีที่แล้ว

      I'm extremely glad to hear that :D

  • @wesleycharles3250
    @wesleycharles3250 ปีที่แล้ว

    Worked here! Tks a lot!

  • @nikop8409
    @nikop8409 ปีที่แล้ว

    Thank you Chris!

  • @felipe.arce96
    @felipe.arce96 7 หลายเดือนก่อน

    What about heavy libraries? Like Spacy.

  • @mumo5154
    @mumo5154 ปีที่แล้ว +1

    it worked

  • @user-ri7cm4ob1e
    @user-ri7cm4ob1e ปีที่แล้ว

    Hi May i know how you are connecting to your shell before creating directory . please comment

  • @user-mj5vy3vk7r
    @user-mj5vy3vk7r ปีที่แล้ว

    thanks buddy❤

  • @genewachtel5900
    @genewachtel5900 9 หลายเดือนก่อน

    Hi Chris I spent all day trying to figure out how to install packages. I found your video and was hoping it would be the solution. I followed each step, but still get errors when trying to install pandas and run. Is there any common issues that you can think of not covered in the video?

  • @AndersonOozie13
    @AndersonOozie13 11 หลายเดือนก่อน

    Have you been able to make a layer for pyodbc that works with mssql server? The latest I see that anyone has made is for python 3.9, but I can't for the life of me get it to work with python 3.11

  • @maximpobihun5469
    @maximpobihun5469 ปีที่แล้ว

    should it be 1 layer per library or can be multiple libraries per one layer?

    • @ImChrisCastro
      @ImChrisCastro  ปีที่แล้ว

      Great question! My current understanding is that you can have as many libraries as you want for a single layer (assuming the libraries file size does not exceed 250 MB - docs.aws.amazon.com/lambda/latest/dg/invocation-layers.html). However, my organization preference is to isolate a single library into a single layer.

  • @gerardoluisbv
    @gerardoluisbv ปีที่แล้ว

    Hi! can a use Boto3 and Request together in this Layer?

    • @ImChrisCastro
      @ImChrisCastro  ปีที่แล้ว

      Yes absolutely! You can use both. Something to keep in mind, you don't need to create a layer for boto3 as that is automatically available in the AWS lambda python environment. However, you would need to create a layer in order to use the requests library.

    • @gerardoluisbv
      @gerardoluisbv ปีที่แล้ว

      @@ImChrisCastro Thanks Chris!

  • @judyatpit
    @judyatpit ปีที่แล้ว

    saved my many hours - mine package name was not python and I could not tell where the problem is

    • @ImChrisCastro
      @ImChrisCastro  ปีที่แล้ว

      Wow, that is great to hear. Glad I could help, Judy!

  • @user-mk6gd9uy8b
    @user-mk6gd9uy8b 9 หลายเดือนก่อน

    That was helpful 🫡

  • @tarungoel22
    @tarungoel22 ปีที่แล้ว

    It seems you are typing for yourself. We cannot see anything that you are typing . God knows who you are making this video for

    • @ImChrisCastro
      @ImChrisCastro  ปีที่แล้ว

      I am making the video for anyone and everyone interested! and yes, haha very small typing indeed!
      I pinned a comment detailing what I typed, but I will paste it here as well:
      Terminal Steps:
      mkdir python
      cd python
      pip3 install [library-name-here] -t .
      cd ..
      zip -r python.zip python