Skip to content

Commit 3d4819b

Browse files
feat: add pip.md (#556)
* doc: update README.md. * doc: update template/contributors.ejs. * Create pip * doc: update README.md. * doc: update template/contributors.ejs. * Rename pip to pip.md * doc: update README.md. * doc: update template/contributors.ejs. --------- Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
1 parent 646e141 commit 3d4819b

File tree

3 files changed

+232
-74
lines changed

3 files changed

+232
-74
lines changed

README.md

Lines changed: 37 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -387,30 +387,30 @@ https://raw.githubusercontent.com/jaywcjlove/linux-command/master/command/<命
387387
<a href="https://github.com/clay-wangzhi" title="clay-wangzhi">
388388
<img src="https://avatars.githubusercontent.com/u/34151437?v=4" width="42;" alt="clay-wangzhi"/>
389389
</a>
390-
<a href="https://github.com/gletthereblight" title="Glett">
391-
<img src="https://avatars.githubusercontent.com/u/29481184?v=4" width="42;" alt="Glett"/>
390+
<a href="https://github.com/hujingnb" title="烟草的香味">
391+
<img src="https://avatars.githubusercontent.com/u/29052630?v=4" width="42;" alt="烟草的香味"/>
392392
</a>
393393
<a href="https://github.com/admxj" title="项金">
394394
<img src="https://avatars.githubusercontent.com/u/15245021?v=4" width="42;" alt="项金"/>
395395
</a>
396-
<a href="https://github.com/hujingnb" title="烟草的香味">
397-
<img src="https://avatars.githubusercontent.com/u/29052630?v=4" width="42;" alt="烟草的香味"/>
398-
</a>
399-
<a href="https://github.com/Jayin" title="Jayin Tang">
400-
<img src="https://avatars.githubusercontent.com/u/2763894?v=4" width="42;" alt="Jayin Tang"/>
396+
<a href="https://github.com/gletthereblight" title="Glett">
397+
<img src="https://avatars.githubusercontent.com/u/29481184?v=4" width="42;" alt="Glett"/>
401398
</a>
402399
<a href="https://github.com/conglinyizhi" title="丛林意志">
403400
<img src="https://avatars.githubusercontent.com/u/42381347?v=4" width="42;" alt="丛林意志"/>
404401
</a>
405-
<a href="https://github.com/pluveto" title="Zijing Zhang">
406-
<img src="https://avatars.githubusercontent.com/u/50045289?v=4" width="42;" alt="Zijing Zhang"/>
402+
<a href="https://github.com/Jayin" title="Jayin Tang">
403+
<img src="https://avatars.githubusercontent.com/u/2763894?v=4" width="42;" alt="Jayin Tang"/>
407404
</a>
408405
<a href="https://github.com/zfb132" title="Fubin Zhang">
409406
<img src="https://avatars.githubusercontent.com/u/18099238?v=4" width="42;" alt="Fubin Zhang"/>
410407
</a>
411408
<a href="https://github.com/lichunqiang" title="__FresHmaN">
412409
<img src="https://avatars.githubusercontent.com/u/2433916?v=4" width="42;" alt="__FresHmaN"/>
413410
</a>
411+
<a href="https://github.com/pluveto" title="Zijing Zhang">
412+
<img src="https://avatars.githubusercontent.com/u/50045289?v=4" width="42;" alt="Zijing Zhang"/>
413+
</a>
414414
<a href="https://github.com/Ernest-su" title="ernest">
415415
<img src="https://avatars.githubusercontent.com/u/5917446?v=4" width="42;" alt="ernest"/>
416416
</a>
@@ -429,6 +429,9 @@ https://raw.githubusercontent.com/jaywcjlove/linux-command/master/command/<命
429429
<a href="https://github.com/lavaicer" title="lavaicer">
430430
<img src="https://avatars.githubusercontent.com/u/52038323?v=4" width="42;" alt="lavaicer"/>
431431
</a>
432+
<a href="https://github.com/ischenyu" title="Shan Chenyu">
433+
<img src="https://avatars.githubusercontent.com/u/103872353?v=4" width="42;" alt="Shan Chenyu"/>
434+
</a>
432435
<a href="https://github.com/SteveLauC" title="SteveLauC">
433436
<img src="https://avatars.githubusercontent.com/u/96880612?v=4" width="42;" alt="SteveLauC"/>
434437
</a>
@@ -438,14 +441,14 @@ https://raw.githubusercontent.com/jaywcjlove/linux-command/master/command/<命
438441
<a href="https://github.com/james-wangx" title="James Wang">
439442
<img src="https://avatars.githubusercontent.com/u/62491424?v=4" width="42;" alt="James Wang"/>
440443
</a>
441-
<a href="https://github.com/Qliangw" title="Qliangw">
442-
<img src="https://avatars.githubusercontent.com/u/22791711?v=4" width="42;" alt="Qliangw"/>
444+
<a href="https://github.com/alfchao" title="alfred">
445+
<img src="https://avatars.githubusercontent.com/u/49786895?v=4" width="42;" alt="alfred"/>
443446
</a>
444447
<a href="https://github.com/Evilrabbit520" title="Wang Jianing">
445448
<img src="https://avatars.githubusercontent.com/u/25611476?v=4" width="42;" alt="Wang Jianing"/>
446449
</a>
447-
<a href="https://github.com/alfchao" title="alfred">
448-
<img src="https://avatars.githubusercontent.com/u/49786895?v=4" width="42;" alt="alfred"/>
450+
<a href="https://github.com/Qliangw" title="Qliangw">
451+
<img src="https://avatars.githubusercontent.com/u/22791711?v=4" width="42;" alt="Qliangw"/>
449452
</a>
450453
<a href="https://github.com/maboloshi" title="沙漠之子">
451454
<img src="https://avatars.githubusercontent.com/u/7850715?v=4" width="42;" alt="沙漠之子"/>
@@ -459,29 +462,32 @@ https://raw.githubusercontent.com/jaywcjlove/linux-command/master/command/<命
459462
<a href="https://github.com/Wvvatt" title="wVVaTT">
460463
<img src="https://avatars.githubusercontent.com/u/38394031?v=4" width="42;" alt="wVVaTT"/>
461464
</a>
462-
<a href="https://github.com/hellof20" title="Pan, Wen-Ming">
463-
<img src="https://avatars.githubusercontent.com/u/8756642?v=4" width="42;" alt="Pan, Wen-Ming"/>
465+
<a href="https://github.com/BingCoke" title="BingCoke">
466+
<img src="https://avatars.githubusercontent.com/u/81607010?v=4" width="42;" alt="BingCoke"/>
464467
</a>
465468
<a href="https://github.com/einverne" title="Ein Verne">
466469
<img src="https://avatars.githubusercontent.com/u/1962738?v=4" width="42;" alt="Ein Verne"/>
467470
</a>
468-
<a href="https://github.com/BingCoke" title="BingCoke">
469-
<img src="https://avatars.githubusercontent.com/u/81607010?v=4" width="42;" alt="BingCoke"/>
471+
<a href="https://github.com/hellof20" title="Pan, Wen-Ming">
472+
<img src="https://avatars.githubusercontent.com/u/8756642?v=4" width="42;" alt="Pan, Wen-Ming"/>
470473
</a>
471474
<a href="https://github.com/RichardLCD" title="RichardLCD">
472475
<img src="https://avatars.githubusercontent.com/u/41584321?v=4" width="42;" alt="RichardLCD"/>
473476
</a>
474-
<a href="https://github.com/XingwenZhang" title="Xingwen Zhang">
475-
<img src="https://avatars.githubusercontent.com/u/21063553?v=4" width="42;" alt="Xingwen Zhang"/>
477+
<a href="https://github.com/gggwvg" title="gggwvg">
478+
<img src="https://avatars.githubusercontent.com/u/6913118?v=4" width="42;" alt="gggwvg"/>
476479
</a>
477-
<a href="https://github.com/Xrtero" title="Xrtero">
478-
<img src="https://avatars.githubusercontent.com/u/55886907?v=4" width="42;" alt="Xrtero"/>
480+
<a href="https://github.com/Dazhuangw" title="Dazhuangw">
481+
<img src="https://avatars.githubusercontent.com/u/74780009?v=4" width="42;" alt="Dazhuangw"/>
479482
</a>
480483
<a href="https://github.com/YanhiWang" title="YH">
481484
<img src="https://avatars.githubusercontent.com/u/114390595?v=4" width="42;" alt="YH"/>
482485
</a>
483-
<a href="https://github.com/Dazhuangw" title="Dazhuangw">
484-
<img src="https://avatars.githubusercontent.com/u/74780009?v=4" width="42;" alt="Dazhuangw"/>
486+
<a href="https://github.com/Xrtero" title="Xrtero">
487+
<img src="https://avatars.githubusercontent.com/u/55886907?v=4" width="42;" alt="Xrtero"/>
488+
</a>
489+
<a href="https://github.com/XingwenZhang" title="Xingwen Zhang">
490+
<img src="https://avatars.githubusercontent.com/u/21063553?v=4" width="42;" alt="Xingwen Zhang"/>
485491
</a>
486492
<a href="https://github.com/shhch" title="shc">
487493
<img src="https://avatars.githubusercontent.com/u/46923522?v=4" width="42;" alt="shc"/>
@@ -495,6 +501,9 @@ https://raw.githubusercontent.com/jaywcjlove/linux-command/master/command/<命
495501
<a href="https://github.com/oliver-zch" title="oliver">
496502
<img src="https://avatars.githubusercontent.com/u/49701721?v=4" width="42;" alt="oliver"/>
497503
</a>
504+
<a href="https://github.com/HDsky" title="黑&蛋">
505+
<img src="https://avatars.githubusercontent.com/u/17249963?v=4" width="42;" alt="黑&蛋"/>
506+
</a>
498507
<a href="https://github.com/z-anshun" title="noodles2hg">
499508
<img src="https://avatars.githubusercontent.com/u/57032282?v=4" width="42;" alt="noodles2hg"/>
500509
</a>
@@ -540,9 +549,6 @@ https://raw.githubusercontent.com/jaywcjlove/linux-command/master/command/<命
540549
<a href="https://github.com/gaohongy" title="ghy">
541550
<img src="https://avatars.githubusercontent.com/u/56125657?v=4" width="42;" alt="ghy"/>
542551
</a>
543-
<a href="https://github.com/gggwvg" title="gggwvg">
544-
<img src="https://avatars.githubusercontent.com/u/6913118?v=4" width="42;" alt="gggwvg"/>
545-
</a>
546552
<a href="https://github.com/mygesty" title="gesty">
547553
<img src="https://avatars.githubusercontent.com/u/30500317?v=4" width="42;" alt="gesty"/>
548554
</a>
@@ -564,9 +570,6 @@ https://raw.githubusercontent.com/jaywcjlove/linux-command/master/command/<命
564570
<a href="https://github.com/daydaygo" title="dayday">
565571
<img src="https://avatars.githubusercontent.com/u/3986303?v=4" width="42;" alt="dayday"/>
566572
</a>
567-
<a href="https://github.com/HDsky" title="黑&蛋">
568-
<img src="https://avatars.githubusercontent.com/u/17249963?v=4" width="42;" alt="黑&蛋"/>
569-
</a>
570573
<a href="https://github.com/catAndZ" title="Panthea Johnson">
571574
<img src="https://avatars.githubusercontent.com/u/101485931?v=4" width="42;" alt="Panthea Johnson"/>
572575
</a>
@@ -651,8 +654,8 @@ https://raw.githubusercontent.com/jaywcjlove/linux-command/master/command/<命
651654
<a href="https://github.com/snovey" title="snovey">
652655
<img src="https://avatars.githubusercontent.com/u/15171147?v=4" width="42;" alt="snovey"/>
653656
</a>
654-
<a href="https://github.com/RocherKong" title="Rocher">
655-
<img src="https://avatars.githubusercontent.com/u/10215178?v=4" width="42;" alt="Rocher"/>
657+
<a href="https://github.com/cxalc" title="cxalc">
658+
<img src="https://avatars.githubusercontent.com/u/79086256?v=4" width="42;" alt="cxalc"/>
656659
</a>
657660
<a href="https://github.com/robigus" title="Robigus">
658661
<img src="https://avatars.githubusercontent.com/u/8164967?v=4" width="42;" alt="Robigus"/>
@@ -735,9 +738,6 @@ https://raw.githubusercontent.com/jaywcjlove/linux-command/master/command/<命
735738
<a href="https://github.com/apnpc" title="Alan">
736739
<img src="https://avatars.githubusercontent.com/u/39884597?v=4" width="42;" alt="Alan"/>
737740
</a>
738-
<a href="https://github.com/cxalc" title="cxalc">
739-
<img src="https://avatars.githubusercontent.com/u/79086256?v=4" width="42;" alt="cxalc"/>
740-
</a>
741741
<a href="https://github.com/121812" title="Forever121">
742742
<img src="https://avatars.githubusercontent.com/u/39209748?v=4" width="42;" alt="Forever121"/>
743743
</a>
@@ -807,9 +807,6 @@ https://raw.githubusercontent.com/jaywcjlove/linux-command/master/command/<命
807807
<a href="https://github.com/Azolla" title="Azolla">
808808
<img src="https://avatars.githubusercontent.com/u/65333936?v=4" width="42;" alt="Azolla"/>
809809
</a>
810-
<a href="https://github.com/ischenyu" title="Shan Chenyu">
811-
<img src="https://avatars.githubusercontent.com/u/103872353?v=4" width="42;" alt="Shan Chenyu"/>
812-
</a>
813810
<a href="https://github.com/seven-steven" title="SevenSteven">
814811
<img src="https://avatars.githubusercontent.com/u/13358658?v=4" width="42;" alt="SevenSteven"/>
815812
</a>
@@ -818,6 +815,9 @@ https://raw.githubusercontent.com/jaywcjlove/linux-command/master/command/<命
818815
</a>
819816
<a href="https://github.com/xinshangshangxin" title="">
820817
<img src="https://avatars.githubusercontent.com/u/8779091?v=4" width="42;" alt=""/>
818+
</a>
819+
<a href="https://github.com/RocherKong" title="Rocher">
820+
<img src="https://avatars.githubusercontent.com/u/10215178?v=4" width="42;" alt="Rocher"/>
821821
</a><!--AUTO_GENERATED_PLEASE_DONT_DELETE_IT-END-->
822822

823823
贡献者列表,由 [contributors](https://github.com/jaywcjlove/github-action-contributors) 自动生成

command/pip.md

Lines changed: 158 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,158 @@
1+
pip
2+
===
3+
4+
Python的库管理工具。
5+
6+
7+
```
8+
用法:
9+
pip <命令> [选项]
10+
11+
命令:
12+
install 安装包。
13+
download 下载包。
14+
uninstall 卸载包。
15+
freeze 以requirements格式输出已安装的包。
16+
inspect 检查 Python 环境。
17+
list 列出已安装的包。
18+
show 显示有关已安装包的信息。
19+
check 验证已安装的包是否具有兼容的依赖关系。
20+
config 管理本地和全局配置。
21+
search 在 PyPI 搜索包。
22+
cache 检查和管理 pip 的wheel缓存。
23+
index 检查从软件包索引中获取的信息。
24+
wheel 从你的要求构建wheels。
25+
hash 计算包存档的哈希值。
26+
completion 用于命令完成的辅助命令。
27+
debug 显示用于调试的有用信息。
28+
help 显示命令的帮助信息。
29+
30+
通用选项:
31+
-h, --help 显示帮助。
32+
--debug 允许未处理的异常传播到主要子例程之外,而不是将其记录到stderr。
33+
--isolated 在隔离模式下运行 pip,忽略环境变量和用户配置。
34+
--require-virtualenv 允许 pip 仅在虚拟环境中运行;否则退出并显示错误。
35+
--python <python> 使用指定的 Python 解释器运行 pip。
36+
-v, --verbose 提供更多输出。该选项是可叠加的,最多可使用3次。
37+
-V, --version 显示版本并退出。
38+
-q, --quiet 提供更少的输出。该选项是可叠加的,最多可使用3次(对应 WARNING、ERROR 和 CRITICAL 日志级别)。
39+
--log <path> 要附加日志的路径。
40+
--no-input 禁用输入提示。
41+
--keyring-provider <keyring_provider>
42+
如果允许用户输入,则启用通过 keyring 库进行凭据查找。指定要使用的机制[disabled, import, subprocess]。(默认: disabled)
43+
--proxy <proxy> 指定代理,格式为 scheme://[user:passwd@]proxy.server:port。
44+
--retries <retries> 每个连接应尝试的最大次数(默认5次)。
45+
--timeout <sec> 设置套接字超时(默认15秒)。
46+
--exists-action <action> 当路径已经存在时的默认操作:(s)切换,(i)忽略,(w)擦除,(b)备份,(a)中止。
47+
--trusted-host <hostname> 将此主机或主机:端口对标记为可信,即使它没有有效或任何 HTTPS。
48+
--cert <path> PEM编码的CA证书包的路径。如果提供,将覆盖默认值。有关更多信息,请参阅 pip 文档中的 'SSL证书验证'。
49+
--client-cert <path> SSL客户端证书的路径,一个包含私钥和PEM格式的证书的单个文件。
50+
--cache-dir <dir> 在 <dir> 中存储缓存数据。
51+
--no-cache-dir 禁用缓存。
52+
--disable-pip-version-check
53+
不定期检查 PyPI 是否有可下载的 pip 新版本。与 --no-index 隐含。
54+
--no-color 抑制有色输出。
55+
--no-python-version-warning
56+
对即将不受支持的 Python 沉默弃用警告。
57+
--use-feature <feature> 启用可能不向后兼容的新功能。
58+
--use-deprecated <feature> 启用在将来将被删除的已弃用功能。
59+
```
60+
61+
## 安装
62+
63+
Pip 是 Python 的包管理工具,通常随着 Python 的安装一起安装。确保你的 Python 版本是 3.4 或更高版本。
64+
65+
```bash
66+
# Ubuntu系统
67+
sudo apt install python3-pip
68+
```
69+
```badh
70+
# CentOS
71+
sudo yum install python3-pip
72+
```
73+
如果需要更新 Pip,可以运行以下命令:
74+
75+
```bash
76+
python -m pip install --upgrade pip
77+
```
78+
79+
## 安装包
80+
81+
通过 Pip 安装 Python 包非常简单。使用以下命令:
82+
83+
```bash
84+
pip install <package_name>
85+
```
86+
87+
例如,安装一个名为 `requests` 的包:
88+
89+
```bash
90+
pip install requests
91+
```
92+
93+
## 卸载包
94+
95+
要卸载已安装的包,使用以下命令:
96+
97+
```bash
98+
pip uninstall package_name
99+
```
100+
101+
例如,卸载 `requests` 包:
102+
103+
```bash
104+
pip uninstall requests
105+
```
106+
107+
## 查看已安装的包
108+
109+
你可以使用以下命令查看当前环境中已安装的所有包及其版本:
110+
111+
```bash
112+
pip list
113+
```
114+
115+
## 导出和导入依赖关系
116+
117+
使用 `pip freeze` 命令可以将当前环境中的所有包及其版本导出到一个文本文件,通常命名为 `requirements.txt`
118+
119+
```bash
120+
pip freeze > requirements.txt
121+
```
122+
123+
要在另一个环境中安装相同的依赖,可以使用以下命令:
124+
125+
```bash
126+
pip install -r requirements.txt
127+
```
128+
129+
## 安装特定版本的包
130+
131+
如果需要安装特定版本的包,可以在包名后面添加版本号:
132+
133+
```bash
134+
pip install package_name==1.2.3
135+
```
136+
137+
## 搜索包
138+
139+
要搜索可用的 Python 包,可以使用 `pip search` 命令:
140+
141+
```bash
142+
pip search package_name
143+
```
144+
145+
## 安装开发版本
146+
147+
有时你可能需要安装包的开发版本。通常,开发版本存储在版本控制系统中(如 GitHub):
148+
149+
```bash
150+
pip install git+https://github.com/user/repo.git
151+
```
152+
153+
这将安装存储库的最新版本。
154+
155+
以上是一些常用的 Pip 命令,希望这个简要教程能够帮助你更好地使用 Python 包管理工具。
156+
157+
## 官网
158+
更多安装使用方法可以访问官网学习:[https://pypi.org/project/pip/](https://pypi.org/project/pip/)

0 commit comments

Comments
 (0)