Skip to content

Commit

Permalink
feat: add pip.md (#556)
Browse files Browse the repository at this point in the history
* 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>
  • Loading branch information
ischenyu and github-actions[bot] authored Jan 16, 2024
1 parent 646e141 commit 3d4819b
Show file tree
Hide file tree
Showing 3 changed files with 232 additions and 74 deletions.
74 changes: 37 additions & 37 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -387,30 +387,30 @@ https://raw.githubusercontent.com/jaywcjlove/linux-command/master/command/<命
<a href="https://github.com/clay-wangzhi" title="clay-wangzhi">
<img src="https://avatars.githubusercontent.com/u/34151437?v=4" width="42;" alt="clay-wangzhi"/>
</a>
<a href="https://github.com/gletthereblight" title="Glett">
<img src="https://avatars.githubusercontent.com/u/29481184?v=4" width="42;" alt="Glett"/>
<a href="https://github.com/hujingnb" title="烟草的香味">
<img src="https://avatars.githubusercontent.com/u/29052630?v=4" width="42;" alt="烟草的香味"/>
</a>
<a href="https://github.com/admxj" title="项金">
<img src="https://avatars.githubusercontent.com/u/15245021?v=4" width="42;" alt="项金"/>
</a>
<a href="https://github.com/hujingnb" title="烟草的香味">
<img src="https://avatars.githubusercontent.com/u/29052630?v=4" width="42;" alt="烟草的香味"/>
</a>
<a href="https://github.com/Jayin" title="Jayin Tang">
<img src="https://avatars.githubusercontent.com/u/2763894?v=4" width="42;" alt="Jayin Tang"/>
<a href="https://github.com/gletthereblight" title="Glett">
<img src="https://avatars.githubusercontent.com/u/29481184?v=4" width="42;" alt="Glett"/>
</a>
<a href="https://github.com/conglinyizhi" title="丛林意志">
<img src="https://avatars.githubusercontent.com/u/42381347?v=4" width="42;" alt="丛林意志"/>
</a>
<a href="https://github.com/pluveto" title="Zijing Zhang">
<img src="https://avatars.githubusercontent.com/u/50045289?v=4" width="42;" alt="Zijing Zhang"/>
<a href="https://github.com/Jayin" title="Jayin Tang">
<img src="https://avatars.githubusercontent.com/u/2763894?v=4" width="42;" alt="Jayin Tang"/>
</a>
<a href="https://github.com/zfb132" title="Fubin Zhang">
<img src="https://avatars.githubusercontent.com/u/18099238?v=4" width="42;" alt="Fubin Zhang"/>
</a>
<a href="https://github.com/lichunqiang" title="__FresHmaN">
<img src="https://avatars.githubusercontent.com/u/2433916?v=4" width="42;" alt="__FresHmaN"/>
</a>
<a href="https://github.com/pluveto" title="Zijing Zhang">
<img src="https://avatars.githubusercontent.com/u/50045289?v=4" width="42;" alt="Zijing Zhang"/>
</a>
<a href="https://github.com/Ernest-su" title="ernest">
<img src="https://avatars.githubusercontent.com/u/5917446?v=4" width="42;" alt="ernest"/>
</a>
Expand All @@ -429,6 +429,9 @@ https://raw.githubusercontent.com/jaywcjlove/linux-command/master/command/<命
<a href="https://github.com/lavaicer" title="lavaicer">
<img src="https://avatars.githubusercontent.com/u/52038323?v=4" width="42;" alt="lavaicer"/>
</a>
<a href="https://github.com/ischenyu" title="Shan Chenyu">
<img src="https://avatars.githubusercontent.com/u/103872353?v=4" width="42;" alt="Shan Chenyu"/>
</a>
<a href="https://github.com/SteveLauC" title="SteveLauC">
<img src="https://avatars.githubusercontent.com/u/96880612?v=4" width="42;" alt="SteveLauC"/>
</a>
Expand All @@ -438,14 +441,14 @@ https://raw.githubusercontent.com/jaywcjlove/linux-command/master/command/<命
<a href="https://github.com/james-wangx" title="James Wang">
<img src="https://avatars.githubusercontent.com/u/62491424?v=4" width="42;" alt="James Wang"/>
</a>
<a href="https://github.com/Qliangw" title="Qliangw">
<img src="https://avatars.githubusercontent.com/u/22791711?v=4" width="42;" alt="Qliangw"/>
<a href="https://github.com/alfchao" title="alfred">
<img src="https://avatars.githubusercontent.com/u/49786895?v=4" width="42;" alt="alfred"/>
</a>
<a href="https://github.com/Evilrabbit520" title="Wang Jianing">
<img src="https://avatars.githubusercontent.com/u/25611476?v=4" width="42;" alt="Wang Jianing"/>
</a>
<a href="https://github.com/alfchao" title="alfred">
<img src="https://avatars.githubusercontent.com/u/49786895?v=4" width="42;" alt="alfred"/>
<a href="https://github.com/Qliangw" title="Qliangw">
<img src="https://avatars.githubusercontent.com/u/22791711?v=4" width="42;" alt="Qliangw"/>
</a>
<a href="https://github.com/maboloshi" title="沙漠之子">
<img src="https://avatars.githubusercontent.com/u/7850715?v=4" width="42;" alt="沙漠之子"/>
Expand All @@ -459,29 +462,32 @@ https://raw.githubusercontent.com/jaywcjlove/linux-command/master/command/<命
<a href="https://github.com/Wvvatt" title="wVVaTT">
<img src="https://avatars.githubusercontent.com/u/38394031?v=4" width="42;" alt="wVVaTT"/>
</a>
<a href="https://github.com/hellof20" title="Pan, Wen-Ming">
<img src="https://avatars.githubusercontent.com/u/8756642?v=4" width="42;" alt="Pan, Wen-Ming"/>
<a href="https://github.com/BingCoke" title="BingCoke">
<img src="https://avatars.githubusercontent.com/u/81607010?v=4" width="42;" alt="BingCoke"/>
</a>
<a href="https://github.com/einverne" title="Ein Verne">
<img src="https://avatars.githubusercontent.com/u/1962738?v=4" width="42;" alt="Ein Verne"/>
</a>
<a href="https://github.com/BingCoke" title="BingCoke">
<img src="https://avatars.githubusercontent.com/u/81607010?v=4" width="42;" alt="BingCoke"/>
<a href="https://github.com/hellof20" title="Pan, Wen-Ming">
<img src="https://avatars.githubusercontent.com/u/8756642?v=4" width="42;" alt="Pan, Wen-Ming"/>
</a>
<a href="https://github.com/RichardLCD" title="RichardLCD">
<img src="https://avatars.githubusercontent.com/u/41584321?v=4" width="42;" alt="RichardLCD"/>
</a>
<a href="https://github.com/XingwenZhang" title="Xingwen Zhang">
<img src="https://avatars.githubusercontent.com/u/21063553?v=4" width="42;" alt="Xingwen Zhang"/>
<a href="https://github.com/gggwvg" title="gggwvg">
<img src="https://avatars.githubusercontent.com/u/6913118?v=4" width="42;" alt="gggwvg"/>
</a>
<a href="https://github.com/Xrtero" title="Xrtero">
<img src="https://avatars.githubusercontent.com/u/55886907?v=4" width="42;" alt="Xrtero"/>
<a href="https://github.com/Dazhuangw" title="Dazhuangw">
<img src="https://avatars.githubusercontent.com/u/74780009?v=4" width="42;" alt="Dazhuangw"/>
</a>
<a href="https://github.com/YanhiWang" title="YH">
<img src="https://avatars.githubusercontent.com/u/114390595?v=4" width="42;" alt="YH"/>
</a>
<a href="https://github.com/Dazhuangw" title="Dazhuangw">
<img src="https://avatars.githubusercontent.com/u/74780009?v=4" width="42;" alt="Dazhuangw"/>
<a href="https://github.com/Xrtero" title="Xrtero">
<img src="https://avatars.githubusercontent.com/u/55886907?v=4" width="42;" alt="Xrtero"/>
</a>
<a href="https://github.com/XingwenZhang" title="Xingwen Zhang">
<img src="https://avatars.githubusercontent.com/u/21063553?v=4" width="42;" alt="Xingwen Zhang"/>
</a>
<a href="https://github.com/shhch" title="shc">
<img src="https://avatars.githubusercontent.com/u/46923522?v=4" width="42;" alt="shc"/>
Expand All @@ -495,6 +501,9 @@ https://raw.githubusercontent.com/jaywcjlove/linux-command/master/command/<命
<a href="https://github.com/oliver-zch" title="oliver">
<img src="https://avatars.githubusercontent.com/u/49701721?v=4" width="42;" alt="oliver"/>
</a>
<a href="https://github.com/HDsky" title="黑&蛋">
<img src="https://avatars.githubusercontent.com/u/17249963?v=4" width="42;" alt="黑&蛋"/>
</a>
<a href="https://github.com/z-anshun" title="noodles2hg">
<img src="https://avatars.githubusercontent.com/u/57032282?v=4" width="42;" alt="noodles2hg"/>
</a>
Expand Down Expand Up @@ -540,9 +549,6 @@ https://raw.githubusercontent.com/jaywcjlove/linux-command/master/command/<命
<a href="https://github.com/gaohongy" title="ghy">
<img src="https://avatars.githubusercontent.com/u/56125657?v=4" width="42;" alt="ghy"/>
</a>
<a href="https://github.com/gggwvg" title="gggwvg">
<img src="https://avatars.githubusercontent.com/u/6913118?v=4" width="42;" alt="gggwvg"/>
</a>
<a href="https://github.com/mygesty" title="gesty">
<img src="https://avatars.githubusercontent.com/u/30500317?v=4" width="42;" alt="gesty"/>
</a>
Expand All @@ -564,9 +570,6 @@ https://raw.githubusercontent.com/jaywcjlove/linux-command/master/command/<命
<a href="https://github.com/daydaygo" title="dayday">
<img src="https://avatars.githubusercontent.com/u/3986303?v=4" width="42;" alt="dayday"/>
</a>
<a href="https://github.com/HDsky" title="黑&蛋">
<img src="https://avatars.githubusercontent.com/u/17249963?v=4" width="42;" alt="黑&蛋"/>
</a>
<a href="https://github.com/catAndZ" title="Panthea Johnson">
<img src="https://avatars.githubusercontent.com/u/101485931?v=4" width="42;" alt="Panthea Johnson"/>
</a>
Expand Down Expand Up @@ -651,8 +654,8 @@ https://raw.githubusercontent.com/jaywcjlove/linux-command/master/command/<命
<a href="https://github.com/snovey" title="snovey">
<img src="https://avatars.githubusercontent.com/u/15171147?v=4" width="42;" alt="snovey"/>
</a>
<a href="https://github.com/RocherKong" title="Rocher">
<img src="https://avatars.githubusercontent.com/u/10215178?v=4" width="42;" alt="Rocher"/>
<a href="https://github.com/cxalc" title="cxalc">
<img src="https://avatars.githubusercontent.com/u/79086256?v=4" width="42;" alt="cxalc"/>
</a>
<a href="https://github.com/robigus" title="Robigus">
<img src="https://avatars.githubusercontent.com/u/8164967?v=4" width="42;" alt="Robigus"/>
Expand Down Expand Up @@ -735,9 +738,6 @@ https://raw.githubusercontent.com/jaywcjlove/linux-command/master/command/<命
<a href="https://github.com/apnpc" title="Alan">
<img src="https://avatars.githubusercontent.com/u/39884597?v=4" width="42;" alt="Alan"/>
</a>
<a href="https://github.com/cxalc" title="cxalc">
<img src="https://avatars.githubusercontent.com/u/79086256?v=4" width="42;" alt="cxalc"/>
</a>
<a href="https://github.com/121812" title="Forever121">
<img src="https://avatars.githubusercontent.com/u/39209748?v=4" width="42;" alt="Forever121"/>
</a>
Expand Down Expand Up @@ -807,9 +807,6 @@ https://raw.githubusercontent.com/jaywcjlove/linux-command/master/command/<命
<a href="https://github.com/Azolla" title="Azolla">
<img src="https://avatars.githubusercontent.com/u/65333936?v=4" width="42;" alt="Azolla"/>
</a>
<a href="https://github.com/ischenyu" title="Shan Chenyu">
<img src="https://avatars.githubusercontent.com/u/103872353?v=4" width="42;" alt="Shan Chenyu"/>
</a>
<a href="https://github.com/seven-steven" title="SevenSteven">
<img src="https://avatars.githubusercontent.com/u/13358658?v=4" width="42;" alt="SevenSteven"/>
</a>
Expand All @@ -818,6 +815,9 @@ https://raw.githubusercontent.com/jaywcjlove/linux-command/master/command/<命
</a>
<a href="https://github.com/xinshangshangxin" title="">
<img src="https://avatars.githubusercontent.com/u/8779091?v=4" width="42;" alt=""/>
</a>
<a href="https://github.com/RocherKong" title="Rocher">
<img src="https://avatars.githubusercontent.com/u/10215178?v=4" width="42;" alt="Rocher"/>
</a><!--AUTO_GENERATED_PLEASE_DONT_DELETE_IT-END-->

贡献者列表,由 [contributors](https://github.com/jaywcjlove/github-action-contributors) 自动生成
Expand Down
158 changes: 158 additions & 0 deletions command/pip.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,158 @@
pip
===

Python的库管理工具。


```
用法:
pip <命令> [选项]
命令:
install 安装包。
download 下载包。
uninstall 卸载包。
freeze 以requirements格式输出已安装的包。
inspect 检查 Python 环境。
list 列出已安装的包。
show 显示有关已安装包的信息。
check 验证已安装的包是否具有兼容的依赖关系。
config 管理本地和全局配置。
search 在 PyPI 搜索包。
cache 检查和管理 pip 的wheel缓存。
index 检查从软件包索引中获取的信息。
wheel 从你的要求构建wheels。
hash 计算包存档的哈希值。
completion 用于命令完成的辅助命令。
debug 显示用于调试的有用信息。
help 显示命令的帮助信息。
通用选项:
-h, --help 显示帮助。
--debug 允许未处理的异常传播到主要子例程之外,而不是将其记录到stderr。
--isolated 在隔离模式下运行 pip,忽略环境变量和用户配置。
--require-virtualenv 允许 pip 仅在虚拟环境中运行;否则退出并显示错误。
--python <python> 使用指定的 Python 解释器运行 pip。
-v, --verbose 提供更多输出。该选项是可叠加的,最多可使用3次。
-V, --version 显示版本并退出。
-q, --quiet 提供更少的输出。该选项是可叠加的,最多可使用3次(对应 WARNING、ERROR 和 CRITICAL 日志级别)。
--log <path> 要附加日志的路径。
--no-input 禁用输入提示。
--keyring-provider <keyring_provider>
如果允许用户输入,则启用通过 keyring 库进行凭据查找。指定要使用的机制[disabled, import, subprocess]。(默认: disabled)
--proxy <proxy> 指定代理,格式为 scheme://[user:passwd@]proxy.server:port。
--retries <retries> 每个连接应尝试的最大次数(默认5次)。
--timeout <sec> 设置套接字超时(默认15秒)。
--exists-action <action> 当路径已经存在时的默认操作:(s)切换,(i)忽略,(w)擦除,(b)备份,(a)中止。
--trusted-host <hostname> 将此主机或主机:端口对标记为可信,即使它没有有效或任何 HTTPS。
--cert <path> PEM编码的CA证书包的路径。如果提供,将覆盖默认值。有关更多信息,请参阅 pip 文档中的 'SSL证书验证'。
--client-cert <path> SSL客户端证书的路径,一个包含私钥和PEM格式的证书的单个文件。
--cache-dir <dir> 在 <dir> 中存储缓存数据。
--no-cache-dir 禁用缓存。
--disable-pip-version-check
不定期检查 PyPI 是否有可下载的 pip 新版本。与 --no-index 隐含。
--no-color 抑制有色输出。
--no-python-version-warning
对即将不受支持的 Python 沉默弃用警告。
--use-feature <feature> 启用可能不向后兼容的新功能。
--use-deprecated <feature> 启用在将来将被删除的已弃用功能。
```

## 安装

Pip 是 Python 的包管理工具,通常随着 Python 的安装一起安装。确保你的 Python 版本是 3.4 或更高版本。

```bash
# Ubuntu系统
sudo apt install python3-pip
```
```badh
# CentOS
sudo yum install python3-pip
```
如果需要更新 Pip,可以运行以下命令:

```bash
python -m pip install --upgrade pip
```

## 安装包

通过 Pip 安装 Python 包非常简单。使用以下命令:

```bash
pip install <package_name>
```

例如,安装一个名为 `requests` 的包:

```bash
pip install requests
```

## 卸载包

要卸载已安装的包,使用以下命令:

```bash
pip uninstall package_name
```

例如,卸载 `requests` 包:

```bash
pip uninstall requests
```

## 查看已安装的包

你可以使用以下命令查看当前环境中已安装的所有包及其版本:

```bash
pip list
```

## 导出和导入依赖关系

使用 `pip freeze` 命令可以将当前环境中的所有包及其版本导出到一个文本文件,通常命名为 `requirements.txt`

```bash
pip freeze > requirements.txt
```

要在另一个环境中安装相同的依赖,可以使用以下命令:

```bash
pip install -r requirements.txt
```

## 安装特定版本的包

如果需要安装特定版本的包,可以在包名后面添加版本号:

```bash
pip install package_name==1.2.3
```

## 搜索包

要搜索可用的 Python 包,可以使用 `pip search` 命令:

```bash
pip search package_name
```

## 安装开发版本

有时你可能需要安装包的开发版本。通常,开发版本存储在版本控制系统中(如 GitHub):

```bash
pip install git+https://github.com/user/repo.git
```

这将安装存储库的最新版本。

以上是一些常用的 Pip 命令,希望这个简要教程能够帮助你更好地使用 Python 包管理工具。

## 官网
更多安装使用方法可以访问官网学习:[https://pypi.org/project/pip/](https://pypi.org/project/pip/)
Loading

0 comments on commit 3d4819b

Please sign in to comment.