Relenv - Build and use relocatable Python environments#

The “standard” Python installation is not relocatable, nor is it easily transferrable to other operating systems in the same family.

Relenv solves that problem and more. Written entirely in Python, it can build relocatable Python packages and use them to create environments that pin all Python interaction to the build of your choice.


You can install relenv like any other python package using pip. Using a virtual environment is recommended.

pip install relenv


After installing relenv, you will have access to its CLI. You can see all supported commands by running the following…

relenv --help

The most common sub command of Relenv is the Create command. Create is used to create new relenv environments. When using relenv for the first time you will need to Build or Fetch pre-built Python build.


The fetch command can be used to download a pre-built Relenv Python.

relenv fetch

Now that you have a base Relenv Python build, you can use the Create command to make new Relenv environments. See the full fetch documentation for more details.


The build command is what relenv uses to build a Relenv Python environment.

relenv build

See the full build documentation for more details.


Use create to make a new relenv environment.

relenv create myenv

The new ‘myenv’ environment is fully self contained. You can pip install any python packages you would like into the new ‘myenv’ environment. Everything will be installed into myenv’s site-packages directory. Any scripts created by pip will use myenv’s Python interpreter. See the full create documentation for more details.

myenv/bin/pip3 install mycoolpackage


Relenv has no public API, but you can find documentation for the internals of relenv here.

Indices and tables#