Python installs multiple packages/PIP usage

Source: Internet
Author: User

List installed Packages

pip freezeor pip list

Export Requirements.txt

pip freeze > <目录>/requirements.txt

installation package Online Installation

pip install <包名>or pip install -r requirements.txt

Specify the version by using = = >= <= > <, and install the latest version without writing

The Requirements.txt content format is:

Apscheduler==2.1.2django==1.5.  4mysql-connector-python==2.0.  1mysql-python==1.2.  3pil==1.1.  7south==1.0.  2django-grappelli==2.6.  3django-pagination==1.0.  7                   
Install the Local installation package

pip install <目录>/<文件名>or pip install --use-wheel --no-index --find-links=wheelhouse/ <包名>

< package name > previous space

can be shortened to

pip install --no-index -f=<目录>/ <包名>

Uninstalling packages

pip uninstall <包名>or pip uninstall -r requirements.txt

Upgrade Package

pip install -U <包名>

Or: Pip Install < package name >--upgrade

Upgrade Pip

pip install -U pip

Show the directory where the package resides

pip show -f <包名>

Search Packages

pip search <搜索关键字>

Querying packages that can be upgraded

pip list -o

Download the package without installing

pip install <包名> -d <目录>or pip install -d <目录> -r requirements.txt

Packaged

pip wheel <包名>

Replacement of domestic pypi mirror domestic pypi Mirror
    • V2ex:pypi.v2ex.com/simple
    • Watercress: Http://pypi.douban.com/simple
    • China University of Science and Technology: http://pypi.mirrors.ustc.edu.cn/simple/
Refers to the order of the secondary installation source

pip install <包名> -i http://pypi.v2ex.com/simple

Specify the global installation source

In Unix and MacOS, the configuration file is: $HOME/.pip/pip.conf
On Windows, the configuration file is:%home%\pip\pip.ini

[global]timeout = 6000  index-url = http://pypi.douban.com/simple


Reference Source: http://www.cnblogs.com/xueweihan/p/4981704.html

Python installs multiple packages/PIP usage

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.