作者:vijay | 来源:互联网 | 2023-05-30 22:09
一:简介
pip 是一个现代的,通用的 Python 包管理工具。提供了对Python 包的查找、下载、安装、卸载的功能。
二:命令
命令 | 描述 |
---|
help | 帮助显示命令的帮助 (Show help for commands.) |
config | 配置本地和全局变量(常用配置仓库的镜像地址) |
list | 列表列出已安装的包 ( List installed packages.) |
install | 安装包安装 (Install packages.) |
uninstall | 卸载卸载包 (Uninstall packages.) |
freeze | 冻结按需求格式安装的包的输出 (Output installed packages in requirements format.) |
check | 检查已安装的软件包是否具有兼容的依赖项 ( Verify installed packages have compatible dependencies.) |
show | 显示已安装软件包的信息 ( Show information about installed packages.) |
download | 下载下载包 (Download packages.) |
search | 搜索PyPI查找包 (Search PyPI for packages.) |
wheel | 根据您的需求构建轮子 (Build wheels from your requirements.) |
hash | 包存档的哈希计算值 ( Compute hashes of package archives.) |
completion | 用于命令完成的辅助命令 ( A helper command used for command completion.) |
debug | 显示对调试有用的信息 ( Show information useful for debugging. |
三:示例
pip --version
pip install --upgrade pip
pip install -U pip
pip help
pip config set global.index-url https://mirrors.aliyun.com/pypi/simple/
pip config unset global.index-url
pip config list
pip list
pip list -o
pip install pip-search
pip-search requests
pip install 包名
pip install 包名==2.28.1
pip install '包名>=2.28.1'
pip install -i https://mirrors.aliyun.com/pypi/simple/包名
pip install --upgrade 包名
pip uninstall 包名
pip download 包名 -d "下载路径"
pip check
pip check 包名
pip show -f 包名
pip freeze > requirements.txt
pip install -r requirements.txt