Nov 28 2008

python packaging

Published by jfrank at 1:12 am under python

Python packaging is a pain in the ass. There are some tools to make it easy, so easy in fact that it becomes even worse…

easy_install is the easiest thing since sliced bread. What does it do? Everything. Its so magic it probably installs itself recursively just for fun.

You want a package?

Ok just type this: easy_install sqlalchemy (for the awesome ORM package for python)

It magically goes and finds sqlalchemy, and installs it INTO your system python installed path.

Why is the standard assumption that if I want to use a python package that is say a dependency for my project, that I want to INSTALL IT INTO PYTHON running on my system?

What kind of crazy idea is this? It causes all kinds of issues. The first and most obvious is: What If I have two programs that expect different versions of a given package? Since the packages are installed in to the runtime and not my app, you have to know about this issue and work around it.

If packages were managed the java way, the assumption would be that I want to install the package in the app that I am working on, not into /systemjdk/extensions/somePackage

The only argument FOR doing it this way that I can think of is saving disk space. Disk space is cheap.

/rant.

Ok so honestly, can anyone tell me why this is?

2 responses so far

2 Responses to “python packaging”

  1. mikeon 29 Nov 2008 at 10:00 am

    you want to use virtualenv, which is the commonly accepted solution for this issue. http://pypi.python.org/pypi/virtualenv/1.3.1

    makes development a whole lot easier than building ant files in Java….

  2. jfrankon 30 Nov 2008 at 12:09 am

    thanks… I’ll have to read up more on it.

Trackback URI | Comments RSS

Leave a Reply