How is it possible to reduce the size of a python virtual environment?
This might be:
- Removing packages from
site_packages
but which one can be removed? - Removing the
*.pyc
files - Checking for used files as mentioned here: https://medium.com/@mojodna/slimming-down-lambda-deployment-zips-b3f6083a1dff
- ...
What else can be removed or stripped down? Or are there other way?
The use case is for example the upload of the virtualenv
to a server with limited space (e.g. AWS Lambda
function with 512 MB limit)