2012年2月9日 星期四

Howto install python easy_install on ubuntu 11.10

easy_install will help installing python modules and here is how we can install it on Ubuntu 11.10

root@ubuntu:~# apt-get install python-setuptools
Reading package lists... Done
Building dependency tree      
Reading state information... Done
The following extra packages will be installed:
  python-pkg-resources
Suggested packages:
  python-distribute python-distribute-doc
The following NEW packages will be installed:
  python-setuptools
The following packages will be upgraded:
  python-pkg-resources
1 upgraded, 1 newly installed, 0 to remove and 61 not upgraded.
Need to get 274 kB of archives.
After this operation, 1,061 kB of additional disk space will be used.
Do you want to continue [Y/n]? y
Get:1 http://us.archive.ubuntu.com/ubuntu/ oneiric-updates/main python-pkg-resources all 0.6.16-1ubuntu0.1 [62.7 kB]
Get:2 http://us.archive.ubuntu.com/ubuntu/ oneiric-updates/main python-setuptools all 0.6.16-1ubuntu0.1 [212 kB]
Fetched 274 kB in 0s (393 kB/s)       
(Reading database ... 52429 files and directories currently installed.)
Preparing to replace python-pkg-resources 0.6.16-1 (using .../python-pkg-resources_0.6.16-1ubuntu0.1_all.deb) ...
Unpacking replacement python-pkg-resources ...
Selecting previously deselected package python-setuptools.
Unpacking python-setuptools (from .../python-setuptools_0.6.16-1ubuntu0.1_all.deb) ...
Setting up python-pkg-resources (0.6.16-1ubuntu0.1) ...
Setting up python-setuptools (0.6.16-1ubuntu0.1) ...


So how to use easy_install? We are going to install python module paste to illustrate the idea.


root@ubuntu:~# easy_install -U paste
Searching for paste
Reading http://pypi.python.org/simple/paste/
Reading http://pythonpaste.org
Best match: Paste 1.7.5.1
Downloading http://pypi.python.org/packages/source/P/Paste/Paste-1.7.5.1.tar.gz#md5=7ea5fabed7dca48eb46dc613c4b6c4ed
Processing Paste-1.7.5.1.tar.gz
Running Paste-1.7.5.1/setup.py -q bdist_egg --dist-dir /tmp/easy_install-I0cKPn/Paste-1.7.5.1/egg-dist-tmp-cdqwYD
warning: no previously-included files matching '*' found under directory 'docs/_build/_sources'
Adding Paste 1.7.5.1 to easy-install.pth file

Installed /usr/local/lib/python2.7/dist-packages/Paste-1.7.5.1-py2.7.egg
Processing dependencies for paste
Finished processing dependencies for paste

沒有留言:

張貼留言