Closed mojeto closed 4 years ago
The dependencies in /var/runtime
aren't installed by lambci/lambda per se – they exist on the Lambda environment itself (you can verify this on a live AWS Lambda) – and so are copied over during image creation
Understood, regarding those libs existing on the live lambda environment. But, it would be nice if the dependencies and their versions could be made explicit, so that it's easier to reconcile with application requirements. As it currently exists, the lambda dependency versions do not seem to be noted anywhere (that I see?), but are indicated in the version conflict error when attempting to install and run.
I'm not sure what you mean by "it would be nice if the dependencies and their versions could be made explicit".
Near I can tell, the only issue here is that virtualenv picks up PYTHONPATH – you just need to unset it when using virtualenv
More discussion on isolating virtualenv from PYTHONPATH here:
https://stackoverflow.com/questions/24583777/why-does-virtualenv-inherit-pythonpath-from-my-shell
https://stackoverflow.com/questions/14591579/how-to-isolate-virtualenv-from-local-dist-packages
TLDR; just unset it and it should work fine
I believe this should now be fixed with https://github.com/lambci/docker-lambda/commit/e69aa8b1f5ed85938e2be61db0ed9f574e17dd58 – I'm just unsetting PYTHONPATH. See https://github.com/lambci/docker-lambda/issues/272#issuecomment-628966591 if you want to revert to the older images that had this env var set.
I'm getting python package dependency conflict when installing zappa into new virtual environment.
I use
lambci/lambda-base:build-python3.6
image to build zappa project.Steps to replicate:
What's happening:
python-dateutil<=2.7.0
dependencypython-dateutil==2.6.1
to solve zappa dependencypython-dateutil==2.6.1
becausevenv
and is injected into python runtime byPYTHONPATH
from outside https://github.com/lambci/docker-lambda/blob/8f6145d649067704c8048578dae4b8e32063839f/python3.6/build/Dockerfile#L6Question:
lambci/lambda:build-python3.6
have extra python dependencies in image that interfere with every virtual environment?Some extra dependencies in
/var/runtime
installed here https://github.com/lambci/docker-lambda/blob/8f6145d649067704c8048578dae4b8e32063839f/python3.6/build/Dockerfile#L22Workaround
I use workaround for this problem by resetting
PYTHONPATH
for now.