Skip to content

Instantly share code, notes, and snippets.

@dameyerdave
Last active March 13, 2024 14:25
Show Gist options
  • Save dameyerdave/4aa731156abc9a4fca8551321b7afeb4 to your computer and use it in GitHub Desktop.
Save dameyerdave/4aa731156abc9a4fca8551321b7afeb4 to your computer and use it in GitHub Desktop.
PIP Bundle

PIP Bundle

This gist describes how to bundle a pip installation and install it on a host with no access to the pip registry. This example uses the pip package power-user-tools.

Create the bundle

mkdir ./bundle
cd bundle
python3 -m pip download --platform linux power-user-tools
cd ..
tar cvzf put.tar.gz bundle

Install the package from the bundle

tar xvzf put.tar.gz
cd bundle
python3 -m pip install --no-index --find-links . power-user-tools

Chagne the python interpreter

cd .local/bin
sed -i 's,#!/usr/local/bin/python,#!/usr/bin/env python3,' $(grep -l '#!/usr/local/bin/python' * | xargs)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment