forked from aws/aws-lambda-builders
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
1 changed file
with
5 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
5449ac3
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks, this solved the IndexError issue you described here by editing the file at C:\Program Files\Amazon\AWSSAMCLI\runtime\Lib\site-packages\aws_lambda_builders\workflows\python_pip\packager.py
I'm still getting other Error: PythonPipBuilder:ResolveDependencies errors, though these could be unrelated.
5449ac3
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That has to be something to do with distutils/setup.py stuff that it can't resolve the dependencies for the bundle, which can be caused by wrong version numbers. E.g. package X v1.0.0 has dependency on package Y v1.0.0 while package Z has dependency on package Y v1.0.1.
This would be my guess.
5449ac3
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I ended up solving it by checking the 'Build function inside a container' checkbox, which AFAIK just adds the --use-container parameter to the SAM command.
5449ac3
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I had the same issue SAM build Error: PythonPipBuilder:ResolveDependencies - list index out of range. I solving it by checking the 'Build function inside a container' checkbox in the PYCharm run configuration.
5449ac3
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
How does it work for VS code? Once I modified the packager.py file that list out of index range error is gone. But I am still getting another error. pip install wheet did not help.
I am trying to build and debug using option available in code it self.
If i run SAM build --use container, it works fine.
An error occurred trying to run SAM Application locally: Error with child process: Building function 'awsToolkitSamLocalResource'
,Running PythonPipBuilder:ResolveDependencies
,Error: PythonPipBuilder:ResolveDependencies - {cryptography==2.9.2(wheel)}Can you please tell me what will be the equivalent o
5449ac3
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@kajalchatterjee
correct:
The error says
So I would check that dependency first. You could create a new venv, and install this dep there, then check the folder structure of the dependency.
However I'm not familiar with VSCode. Probably you could change the config of vscode to run the thing with
--use-container
option then attach to the process. (Also I don't know what the--use-container
option does)So I recommend trying to debug without the SAM setup, in a different venv.
5449ac3
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
How is one supposed to resolve this issue if sam is installed on Linux and the lambda-builder dependency is brought in via the requirements.txt file?