Unable to run sam cli on Windows Subsystem for Linux 2

1.5k views Asked by At

Followed the instructions here to install sam-cli on Windows Subsystem for Linux (Ubuntu)

$ brew tap aws/tap
    Updating Homebrew...

$ brew install aws-sam-cli
    Updating Homebrew...
    ==> Installing aws-sam-cli from aws/tap
    ==> Downloading https://github.com/aws/aws-sam-cli/releases/download/v1.4.0//aws-sam-cli-1.4.0.x86_64_linux.bottle.tar.gAlready downloaded: /home/alper/.cache/Homebrew/downloads/6d52b1709eccad9b947a7cc8ef96155867ea2c3be910b31536713390d07dc03c--aws-sam-cli-1.4.0.x86_64_linux.bottle.tar.gz
    ==> Pouring aws-sam-cli-1.4.0.x86_64_linux.bottle.tar.gz
      /home/linuxbrew/.linuxbrew/Cellar/aws-sam-cli/1.4.0: 4,153 files, 90.8MB

$ sam --version
    /home/linuxbrew/.linuxbrew/Cellar/aws-sam-cli/1.4.0/libexec/bin/python3.7: error while loading shared libraries: libpython3.7m.so.1.0: cannot open shared object file: No such file or directory

Getting a python error. Any ideas?

1

There are 1 answers

0
Kent Wong On

Please follow the official documentation and do not use Brew when installing for WSL; https://docs.aws.amazon.com/serverless-application-model/latest/developerguide/serverless-sam-cli-install-linux.html

I was able to install and use AWS SAM for WSL2 with Ubuntu 20.04.4 LTS