lambci / docker-lambda

Docker images and test runners that replicate the live AWS Lambda environment
MIT License
5.83k stars 431 forks source link

python3.8 error building on stock Ubuntu-20.24 WSL2 #296

Closed chadbrewbaker closed 4 years ago

chadbrewbaker commented 4 years ago

Building python3.8 on stock a fresh Ubuntu-20.24 WSL2 yields one error. Not sure if it is critical as the build finishes.

... Successfully built PyYAML future pyrsistent ERROR: aws-sam-cli 0.53.0 has requirement boto3>=1.13.0,~=1.13.0, but you'll have boto3 1.14.23 which is incompatible. ... Successfully built 0522c30a6c45

chadbrewbaker commented 4 years ago

I fired it up in interactive mode and it seems to work. Win10 -> WSL2-Ubuntu20.24 -> python3.8dockerlambda

sam --version
#295 SAM CLI, version 0.53.0

Any sam commands I should test with, or is the higher boto3 version known to be backwards compatible?

mhart commented 4 years ago

Should be compatible. Feel free to reopen if you see an issue

jfuss commented 4 years ago

@chadbrewbaker This will happen from time to time because docker-lambda's images do not isolate installs between SAM CLI/AWS CLI/ or any other package you will end up pip installing. Docker-lambda should be installing the tools into their or venv so tools and your dependencies do not clash with one another.

mhart commented 4 years ago

@jfuss a PR from AWS would be great. I tried to get pipx working a while back, but couldn't get it to play nice with Amazon Linux's python installation. The error looks similar to https://github.com/pipxproject/pipx/issues/393 but couldn't get the workaround there to work.

mhart commented 4 years ago

Looks like https://github.com/pipxproject/pipx/issues/218 is the root cause – will see if I can get a workaround

mhart commented 4 years ago

I think I've found a workaround, though it's pretty ugly.

Requires running pipx once, which will then fail (due to pipxproject/pipx#218), so just ignore the error and then running activate on the pipx venv before installing the various binaries with pipx.

297 should address – @jfuss let me know if you see anything that might impact existing SAM Local users with that PR.

mhart commented 4 years ago

These changes have been pushed – should be no more issues with clashing global python libs 🤞