Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

PythonPipBuilder:ResolveDependencies - Could not satisfy the requirement (local module) #155

Closed
michaelmelody91 opened this issue Feb 10, 2020 · 1 comment

Comments

@michaelmelody91
Copy link

Unable to switch from AWS Layer to specifying locally built editable pip3 packages when executing function:

I'm both learning python and attempting to build multiple lambdas that will both store and process Spotify listening history. I originally wrote one lambda with all dependencies packaged in the same directory and imported using relative paths.

Once creating similar functions which use the same dependencies, I've split the dependencies from the function and built them using pip3 and setup.py. When running pip3 list I can see the packages as expected. To execute the function locally using sam build && sam local invoke SpotifyPlayHistoryListener --env-vars env.json --event events/event.json and verify success, I'm specifying a layer I've built - this works!

To avoid having to rebuild the layer and modifying my function, I'd like to be able to revert to using a requirements.txt file and removing the specified layer.

Steps to reproduce the issue:

  1. Build local editable package - pip3 install -e .
  2. Specify in requirements.txt
  3. sam build && sam local invoke SpotifyPlayHistoryListener --env-vars env.json --event events/event.json

Observed result:

Building resource 'SpotifyPlayHistoryListener'
Running PythonPipBuilder:ResolveDependencies

Build Failed
Error: PythonPipBuilder:ResolveDependencies - Could not satisfy the requirement: spotify-client

Expected result:

Build succeeds and function executes successfully.

Additional environment details:

I'm able to execute the function locally using sam build && sam local invoke SpotifyPlayHistoryListener --env-vars env.json --event events/event.json when specfying dependencies using a Layer

I'm open to being told I'm completely off the mark here. Though I feel like I'm not a million miles away.

@awood45
Copy link
Member

awood45 commented Mar 3, 2020

Looks like this was answered in the related aws-sam-cli issue and this issue has become a duplicate. Closing.

@awood45 awood45 closed this as completed Mar 3, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants