Skip to content
Zoran Simic edited this page Sep 6, 2021 · 2 revisions

portable-python is a python CLI that aims to make compiling portable python binaries automatable.

What is a "portable python"?

It's a binary python distribution (.tar.gz or .zip) that can be decompressed in any folder, and used from there without further ado (ie: no need to run an "installer" and things like that).

The idea here is to allow for automated systems to:

  • Easily obtain a python binary, that can be used in sandboxes / workstations / laptops / instances...

  • Have an open source tool that can compile such portable pythons reliably, without having to worry about the compilation part.

  • Be able to inspect any python installation, and point out how portable it is, which shared or non-standard libraries it is using

Installation

portable-python can be installed like any other python CLI:

With pickley:

pickley install portable-python
portable-python --help
portable-python inspect /usr/bin/python3

With pipx

pipx run portable-python inspect /usr/bin/python3

Using pip install (a CI builder would probably do this):

/usr/bin/python3 -mvenv /tmp/pp
/tmp/pp/bin/python -mpip install portable-python
/tmp/pp/bin/portable-python --help
/tmp/pp/bin/portable-python inspect /usr/bin/python3