Problem with Pythoncard

Steve M sjmaster at gmail.com
Fri Aug 26 17:20:52 EDT 2005


There are some Python packages that I prefer to get from the developer
instead of from my Linux distribution (Debian).
Usually it is because I intend to upgrade the package before, or more
often than, my distribution releases a new version. (A likely scenario
if you use Debian - zing!)

So I download the source.tar.gz from the developer. I extract it into
~/src, change to the directory and run "python setup.py build". (Here
you might recursively detour to install a dependency.) Then I change to
the build/lib directory and in there is all of the modules. In
build/scripts will be any included scripts. I copy the contents of
build/lib to ~/python/lib and the scripts to ~/python/scripts.
(Alternatively I could make symbolic links.) My PYTHONPATH environment
variable includes ~/python/lib. (Alternatively you can modify
sitecustomize.py to insert that directory into the sys.path but this
could have system-wide implications.) You can also add ~/python/scripts
to your command path. (I tend to manually type the path whenever I want
to run something in there.)

Now the package is available for import from any python program that I
run. I can reproduce this on a system that I do not have root for but
only a user shell account. It is easy to transfer the whole library to
another computer just by copying the relevant directories. And if I
want to upgrade I can download the new source tarball, build it, and
change the symlinks or overwrite the old directory contents.

I find this is a reasonably convenient way to have up-to-date packages
from the Python world on my stable-but-not-entirely-state-of-the-art
Debian system. I'm sure as time goes by I'll refine this system. Or
maybe Python Eggs will solve most of the problems...




More information about the Python-list mailing list