程序師世界是廣大編程愛好者互助、分享、學習的平台,程序師世界有你更精彩!
首頁
編程語言
C語言|JAVA編程
Python編程
網頁編程
ASP編程|PHP編程
JSP編程
數據庫知識
MYSQL數據庫|SqlServer數據庫
Oracle數據庫|DB2數據庫
您现在的位置: 程式師世界 >> 編程語言 >  >> 更多編程語言 >> Python

Python PIP command

編輯:Python

Using Alibaba cloud server , Use pip When installing the third-party library, the card will die . So I thought pip Can I install the local package .

Found this blog :

install
sudo easy_install pip

List installed packages
pip freeze or pip list

export requirements.txt
pip freeze > < Catalog >/requirements.txt

Installation package
Online installation
pip install < Package name > or pip install -r requirements.txt

By using == >= <= > < To specify the version , If not, install the latest version

requirements.txt The content format is :

APScheduler2.1.2
Django
1.5.4
MySQL-Connector-Python2.0.1
MySQL-python
1.2.3
PIL1.1.7
South
1.0.2
django-grappelli2.6.3
django-pagination
1.0.7
Install the local installation package
pip install < Catalog >/< file name > or pip install --use-wheel --no-index --find-links=wheelhouse/ < Package name >

< Package name > There is a space before

It can be abbreviated as

pip install --no-index -f=< Catalog >/ < Package name >

Uninstall package
pip uninstall < Package name > or pip uninstall -r requirements.txt

Upgrade package
pip install -U < Package name >

or :pip install < Package name > --upgrade

upgrade pip
pip install -U pip

Displays the directory where the package is located
pip show -f < Package name >

Search package
pip search < Search for keywords >

Query upgradeable packages
pip list -o

Download package without installing
pip install < Package name > -d < Catalog > or pip install -d < Catalog > -r requirements.txt

pack
pip wheel < Package name >

Replace domestic pypi Mirror image
At home pypi Mirror image
Ali :https://mirrors.aliyun.com/pypi/simple
University of science and technology of China :http://pypi.mirrors.ustc.edu.cn/simple/
Specify a single install source
pip install < Package name > -i https://mirrors.aliyun.com/pypi/simple

Specify global installation source
stay unix and macos, The configuration file is :$HOME/.pip/pip.conf
stay windows On , The configuration file is :%HOME%\pip\pip.ini

[global]
timeout = 6000
index-url = https://mirrors.aliyun.com/pypi/simple
Reproduced in https://www.cnblogs.com/xueweihan/p/4981704.html
https://me.iblogc.com/2015/01/01/pip%E5%B8%B8%E7%94%A8%E5%91%BD%E4%BB%A4/


  1. 上一篇文章:
  2. 下一篇文章:
Copyright © 程式師世界 All Rights Reserved