{"action":"opened","issue":{"url":"https://api.github.com/repos/awslabs/serverless-application-model/issues/740","repository_url":"https://api.github.com/repos/awslabs/serverless-application-model","labels_url":"https://api.github.com/repos/awslabs/serverless-application-model/issues/740/labels{/name}","comments_url":"https://api.github.com/repos/awslabs/serverless-application-model/issues/740/comments","events_url":"https://api.github.com/repos/awslabs/serverless-application-model/issues/740/events","html_url":"https://github.com/awslabs/serverless-application-model/issues/740","id":394999599,"node_id":"MDU6SXNzdWUzOTQ5OTk1OTk=","number":740,"title":"`sam local` does not use result of `sam build`","user":{"login":"radix","id":227068,"node_id":"MDQ6VXNlcjIyNzA2OA==","avatar_url":"https://avatars1.githubusercontent.com/u/227068?v=4","gravatar_id":"","url":"https://api.github.com/users/radix","html_url":"https://github.com/radix","followers_url":"https://api.github.com/users/radix/followers","following_url":"https://api.github.com/users/radix/following{/other_user}","gists_url":"https://api.github.com/users/radix/gists{/gist_id}","starred_url":"https://api.github.com/users/radix/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/radix/subscriptions","organizations_url":"https://api.github.com/users/radix/orgs","repos_url":"https://api.github.com/users/radix/repos","events_url":"https://api.github.com/users/radix/events{/privacy}","received_events_url":"https://api.github.com/users/radix/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2018-12-31T16:00:23Z","updated_at":"2018-12-31T16:00:23Z","closed_at":null,"author_association":"NONE","body":"**Description:**\r\n\r\nVarious pieces of documentation suggest that I can use `sam build` followed directly by `sam local invoke`. However, when I use `sam local invoke`, it is not using the result of my `sam build` process -- none of the dependencies I have in my requirements.txt are available. I have verified this with a `print(os.listdir('/var/task'))` in my lambda function, and with the fact that `import`ing my dependencies is failing.\r\n\r\nHowever, things work fine if, after a build, I `cd .aws-sam/build/MyFunction; sam local invoke ...`. It uses the dependencies that are available in the built function directory.\r\n\r\n**Steps to reproduce the issue:**\r\n1. create a sam package that uses a requirements.txt and run `sam build -u`\r\n2. run `sam local invoke ...` on that function\r\n\r\n**Observed result:**\r\nreceive an ImportError about not being able to import one of the dependencies\r\n\r\n**Expected result:**\r\nimport should work.\r\n\r\nAlternatively, the documentation should be updated to indicate that you need to run `sam local` from inside one of the `.aws-sam/build` subdirectories.\r\n"}}
{"actor":{"display_login":"radix"}}