This issue seems to be known and existing for quite a long time now, despite already having a solution: https://github.com/awslabs/aws-sam-local/pull/57
Is there some hindrance to reopen and add this merge request for now? I think it would be sufficient to have at least a working solution, refactoring it later on when a more elegant way to do it comes up (as @sanathkr mentioned).
I had the same result trying to install SAM Local on a Windows machine.
Also had the same result on a Mac.
Reading #57, it seems there were some hesitations about creating the symlink on install because it wasn't an elegant solution. However, I just want to share my opinion that this makes for a pretty rough developer experience -- nowadays most of us are used to just installing something via a package manager and diving in. I could see some folks getting stuck on this and deciding to pursue other tooling.
@sanathkr any chance this could be reconsidered? Or could we at least document here what the most minimal steps would be to get SAM Local working, so if other folks land here they can get past the error?
Note to self: don't yarn global add aws-sam-local. Use npm i -g aws-sam-local. And then it works :)
However, I would still argue that this behavior is a a little unexpected and could be improved... there are so many Yarn users out there and it would be a shame if they gave up on SAM Local because of this!
With the new release: https://github.com/awslabs/aws-sam-cli/releases/tag/v0.3.0 I don't think this is relevant anymore.
Please reopen if this is incorrect.
If you have installed your sam using pip, consider checking your path variable to include Python bin path.
Add python bin path to ~.bash_profile
/Users/
Adding the following into ~.bash_profile helped.
export PATH=$PATH:/Users/username/Library/Python/2.7/bin
The path can be found by running:
python -m site --user-base
Adding the following into ~.bash_profile helped.
export PATH=$PATH:/Users/_username_/Library/Python/2.7/binThe path can be found by running:
python -m site --user-base
this also works for Ubuntu (18.04),
python -m site --user-base gave me /home/user/.local/ where I found bin
@jfuss It could be good to reopen this issue for Ubuntu 18.04 and pip (python2)
OSX 10.13.2 - adding export PATH=$PATH:/Users/ryan/Library/Python/3.7/bin to .bash_profile worked for me.
Oddly enough python -m site --user-base gave me /Users/ryan/Library/Python/2.7, but that folder didn't exist on my system.
Most helpful comment
Adding the following into ~.bash_profile helped.
export PATH=$PATH:/Users/username/Library/Python/2.7/bin
The path can be found by running:
python -m site --user-base