Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

State of Python Packaging: Buildout, Distribute, Distutils, EasyInstall, etc

Tags:

The last time I had to worry about installing Python packages was two years ago working with Enthought, NumPy and MayaVi2. That experience gave me lingering nightmares related to quirky behavior installing & updating Python packages in non-standard locations (in $HOME/usr/local2.6/, for example).

Anyway, my work is taking me back to installing various Python packages. The CheeseShop Tutorial mentions DistUtils and EasyInstall in addition to Buildout! I am having a hard time finding one place that compares these (and other) PyPi installation tools, so I am hoping to tap into the StackOverflow community: What are the strengths & weaknesses of each installation tool?

like image 852
Pete Avatar asked Dec 29 '09 23:12

Pete


People also ask

What is Python distribution package?

Distribution Package. A versioned archive file that contains Python packages, modules, and other resource files that are used to distribute a Release. The archive file is what an end-user will download from the internet and install.

How do you distribute a project in Python?

Use PyInstaller, py2exe, Nuitka, or another bundling solution. The most convenient way to deliver a Python application to a user is to provide them with an executable—either a single file or a directory with an easily identified executable somewhere in it.


2 Answers

First of all, regardless of installation tool you decide on, start using virtualenv --no-site-packages! That way, python packages are not installed globally and you can easily get back to where you were in old as well as new projects.

Now, your comparison is a little bit apples-to-pears as the tools you list are not mutually exclusive. However, I can wholly recommend Buildout. It will install python packages as well as other stuff and lets you automate installation and deployment of (complex) projects.

Also, I recommend looking into Fabric as a means to automate administrative tasks.

like image 89
lemonad Avatar answered Oct 29 '22 23:10

lemonad


Distribute is a new fork of setuptools (easy_install), which should also be considered. Even Guido recommends it.

Buildout is orthogonal to the packaging --- you can use buildout with distribute.

like image 37
Alex Brasetvik Avatar answered Oct 29 '22 23:10

Alex Brasetvik