Reputation: 514
I'm learning Python now 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?
Upvotes: 35
Views: 14155
Reputation: 21947
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.
Upvotes: 2
Reputation: 619
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.
Upvotes: 11
Reputation: 3702
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.
Upvotes: 33