Hec
Hec

Reputation: 874

How to pre-build Python binaries

I am trying to deploy a Python environment as an RPM. Since the target systems may not have an Internet connection and/or a C compiler, going the download on the fly route may not work. The development environment is Python 2.7.10 with some modules installed via pip.

How do I pre-build the Python environment like ActiveState Python does?

Upvotes: 1

Views: 1317

Answers (1)

Katie Lucas
Katie Lucas

Reputation: 31

There's a tool called "PEX" which Twitter use to pre-compile a stack of Python code, plus libraries, module,s and support data into a single bundle.

It's a basically a zipped archive of a environment which will launch like it's an EXE file.

There are a few caveats -- one, it takes a while for them to start up. Two, the files will only work on the same version of Python you built them one -- if you have a hybrid 3.0/2.7/2.6 environment, it gets complicated.

PEX itself has a couple of outstanding gotchas around caching of installs and things.

Upvotes: 3

Related Questions