开发者

Is there an automated way to install python modules (à la rubygems)?

开发者 https://www.devze.com 2023-01-30 01:21 出处:网络
I\'m new to python. Are there alternatives to downloading a tarball for a python module & installing it via python setup install ? Anything like rubygems?

I'm new to python. Are there alternatives to downloading a tarball for a python module & installing it via python setup install ? Anything like rubygems?

UPDATE I'm surprised that there ar开发者_Go百科e so many solutions for this one problem.


setuptools is one option. Install that and then you can install many Python modules using the easy_install command-line tool.


There are many options - you can stick with your system's default packaging system (if it has one) or you can pick one (or more) of existing Python tools like easy_install, zc.buildout or pip. I would recommend you to use Distribute together with pip.


easy_install or pip. I also recommend checking out virtualenv to isolate environments for test running packages. The Python Package Index(pypi, also called Cheeseshop) is the official third-party software repository for Python.


Pip is great:

$ pip install some_python_module
$ pip freeze > requirements.txt
$ cat requirements.txt

Output from freeze:

Creoleparser==0.7.3
Django==1.3
Genshi==0.6
PIL==1.1.7
South==0.7.3
django-debug-toolbar==0.8.5
....

After this in any other place:

$ pip install < requirements.txt


Checkout pip

0

精彩评论

暂无评论...
验证码 换一张
取 消