How to Deploy a Lambda Function Using a Local Python Package

Hi!

TLDR;
Unable to link dependency `my_local_python_package` becasue a file by the same name exists in this service

Turns out that the error message is spot-on. During deployment, a temporary symlink is created, and the symlink that it was trying to create would have overwritten the name of my folder containing my python package code. I placed my python package within the folder src so there would be no name conflict.

I’m attempting to deploy a Lambda function, written in Python, that uses a custom, local Python package called kcam. Below is my layout.

tree
*My Lambda handler function is inside foo.py

In order to install my_package, I have been typing pip install -e .
*Note the period at the end.

So now, in order to deploy my Lambda, I have made my requirements.txt like so:
requirements
*Note the period at the top.

I’m able to install everything with sls requirements install

However I’m running into an error with sls deploy

Hiya,

As this problem be solved because I am facing a similar issue.
I have an external python package that I can install in my virtual env which is then appearing in my requirements.txt file but I would needd somehow to have this package transfered so that it can be reinstalled on the server side

Here is my error message:

Could not find a version that satisfies the requirement ncapi-client==0.0.5 (from -r /var/task/requirements.txt (line 14)) (from versions: )
No matching distribution found for ncapi-client==0.0.5 (from -r /var/task/requirements.txt (line 14))