The Easy_install tool in Python works very well, and it acts like a pear in PHP, or a gem in Ruby, or a cpan in Perl.
1.easy_install Installation
If you want to use the Easy_install tool, you need to install Setuptools first, but the cool way is to use the ez_setup.py script:
Execute the following command:
| 12 |
shell# wget -q http://peak.telecommunity.com/dist/ez_setup.pyshell# python ez_setup.py |
After installation, it is best to ensure that the directory where the Easy_install is located has been added to the PATH environment variable:
Linux:/usr/local/bin
For example, to install the Python MySQL support, you can execute the following command, the system will automatically find the relevant package in the PYPI Web site list:
| 1 |
easy_install MySQL-python |
With the Easy_install installation software, the relevant installation information is saved to the Easy-install.pth file, which is similar to the following path:
Linux:/usr/local/lib/python25/site-packages/easy-install.pth
If you want to delete a package installed through Easy_install, say: Mysql-python, you can execute the command:
| 1 |
easy_install -m MySQL-python |
This action will erase the Mysql-python information from the Easy-install.pth file, and the remaining egg files can be deleted manually.
2.easy_install use of the detailed
Method One:
Based on the installation package name you want to Easy_install, the tool will retrieve the latest version of the Web page query package, automatically download, build and install
| 1 |
easy_install MySQL-python |
Method Two:
Specify URL to update or install, similar to use one, more parameter-F and the address used to specify the page only specify the page address
| 1 |
easy_install -f http://pythonpaste.org/package_index.html SQLObject |
Method Three:
Use only URLs to Easy_install installation
| 1 |
easy_install http://example.com/path/to/MyPackage-1.2.3.tgz |
Method Four
Easy_install Install the downloaded egg file (the egg file is a compressed file packaged with Setup tools)
| 1 |
easy_install /my_downloads/OtherPackage-3.2.1-py2.3.egg |
Method Five:
Upgrade package, sometimes you need to update the package version
| 1 |
easy_install --upgrade PyProtocols |
Installation and use of Linux under Easy_install