2

I'm having some trouble using the new aws toolkit for pycharm. When I try to run locally the lambda hello-world from the template I get the following error

Error running '[Local] app.lambda_handler': Failed to locate module for PyFile:app.py

any suggestion? Thanks

Paolo Fusari
  • 105
  • 12
  • 1
    This problem can be solved marking the source code folder containing app.py defined in your template as a source code, making this pycharm will be able to find app.py. If you want more detail you can reference this [article](https://medium.com/@fusari.pool/in-this-series-ill-try-explain-how-to-survive-to-aws-sam-don-t-get-me-wrong-i-really-like-this-3c1ff2dfca68) – Paolo Fusari Aug 29 '19 at 08:49

2 Answers2

1

I assume you tried to run the SAM hello world template with python 3.x. It should work with python 2.7. The issue might be related to: https://github.com/aws/aws-toolkit-jetbrains/issues/698

The hello world example works with python 2.7. Tried it today [16.01.2019].

stgrmks
  • 141
  • 5
0

Related to: https://github.com/aws/aws-toolkit-jetbrains/issues/372.

Somehow the local AWS does not read the CodeUri when its not set to the project's directory. Meaning that you will have to change the CodeUri setting in our properties to .

Note that when resetting your CodeUri to your main project folder you will also have to move the requirements.txt to ..