Created
May 1, 2018 15:36
-
-
Save vrillusions/150208d08f34e281b958a15793b2a46e to your computer and use it in GitHub Desktop.
How to install python packages completely from local files
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
# Original use case for this is on a jenkins server where jobs wipe their working | |
# directories and wipes the virtual environment with it. Was abandoned as we just | |
# got a regular caching server that it uses | |
# run these at initial setup and if requirements or pip version changes | |
# and yes old version of pip used `pip install --download` and newer versions | |
# use `pip download`. | |
mkdir -p "${HOME}/.cache/pip/localcache" | |
pip install --download "${HOME}/.cache/pip/localcache" -U pip setuptools | |
pip install --no-index --find-links="${HOME}/.cache/pip/localcache" -U pip setuptools | |
pip download -d "${HOME}/.cache/pip/localcache" -r requirements.txt | |
pip wheel -w "${HOME}/.cache/pip/localcache" -r requirements.txt | |
# actual commands to do at the start of each run | |
pip install --no-index --find-links="${HOME}/.cache/pip/localcache" -U pip setuptools | |
pip install --no-index --find-links="${HOME}/.cache/pip/localcache" -r requirements.txt |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment