Export packages

I have a project with several dependencies installed using virtualenv and pip. I want to run a project on a server on which the protocol is not installed. Unfortunately installing pip is not an option.

Is there a way to export my required packages and link them to my project? What is the general approach in this situation?

+5
source share
3 answers

Twitter uses pex files to associate Python code with its dependencies. This will create a single file. Another important tool is platter , which also aims to reduce the complexity of deploying Python code to a server.

Another alternative is to write a tool yourself, which creates a zip file with Python and dependencies and unzips it in the right place on the server.

A zipapp module was added in Python 3.5 to improve support for this way to deploy / use code. This allows you to control the creation of zip files containing Python code and run them directly using the Python interpreter.

+5
source

@ Simeon Wisser's answer is a good way to handle this. Mine should build my python project using buildout .

0
source

This may be outside the scope of the question, but if your need is to deploy applications on servers with their dependencies, look at virtualization and linux containers.

This is the most commonly used solution to this problem and will work with any type of application (python or not), and it is lightweight (in most cases, the LXC performance is not noticeable, and highlighting applications is a BIG function).

Container dockers, in addition to being fashionable now, are a very convenient way to deploy applications without worrying about dependencies, etc.

The same goes for tramp development.

0
source

All Articles