Last active
November 2, 2023 12:32
-
-
Save alberic89/7b972597112478756a157f0ba329db6c to your computer and use it in GitHub Desktop.
Compile python libs in the env
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
cd env/lib && find -name "*.pyc" -delete && python -OO -m compileall . -j 0 && find . -path "*/__pycache__/*.pyc" -execdir sh -c "mv {} ../\$(basename {} | cut -d'.' -f1).pyc" \; && find -name "*.py" -delete && cd ../.. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Gain disk space by compiling your python libs.
The .pyc files are not portables between two differents version of Python or two machines.