tags:

views:

1189

answers:

4

Hi,

I'm new to Python, reason I'm learning it right now is because of the Django framework. I have been a Perl programmer for a number of years and I'm so used to Perl's tools. One of the things that I really miss is Perl's CPAN and its tools. Is there anything equivalent in Python? I would like to be able to search, install and maintain Python modules as easy as CPAN. Also, a system that can handle dependencies automatically. I tried to install a module in Python by downloading a zip file from a website, unzipped it, then do:

sudo python setup.py install

but it's looking for another module. Now, lazy as I am, I don't like chasing dependencies and such, is there an easy way? Thanks.

sammydc says:

I installed pip and it's working now. Thanks very much llimllib.

+1  A: 

Yes, it's called EasyInstall

Jimmy2Times
+21  A: 

sammy, have a look at pip, which will let you do "pip install foo", and will download and install its dependencies (as long as they're on PyPI). There's also EasyInstall, but pip is intended to replace that.

llimllib
+6  A: 

It might be useful to note that pip and easy_install both use the Python Package Index (PyPI), sometimes called the "Cheeseshop", to search for packages. Easy_install is currently the most universally supported, as it works with both setuptools and distutils style packaging, completely. See James Bennett's commentary on python packaging for good reasons to use pip, and Ian Bicking's reply for some clarifications on the differences.

alif
+1  A: 

If you do use easy_install, I'd suggest installing packages by doing..

easy_install -v -Z package_name  |  tee date-package.log

-Z (short for --always-unzip) unzips the .egg files to directories so you can then..

less *.egg/EGG-INFO/requires.txt  
less *.egg/EGG-INFO/PKG-INFO  
egrep '^(Name|Version|Sum|...)'  *.egg/EGG-INFO/PKG-INFO

On Sammy's original question, a couple of package indexes other than PyPI are:
Scipy and Scipy docs for scientific computing
ohloh with code metrics.

Denis