Skip to content

pip 常用命令

更新: 4/1/2025 字数: 0 字 时长: 0 分钟

bash
# 升级 pip
pip install --upgrade pip
# 或
python -m pip install --upgrade pip
bash
# 查看已安装的包
pip list

# 安装包
pip install [包名]

# 安装本地包
pip install [目录]/[文件名]

# 查看包的安装位置
pip show [包名]

# 卸载包
pip uninstall [包名]
bash
# 查看可升级的包
pip list -o

# 升级包
pip install -U [包名]

# 搜索包
pip search [搜索关键字]
bash
# 导出依赖 
pip freeze > requirements.txt

# 安装依赖
pip install -r requirements.txt

# 卸载依赖
pip uninstall -r requirements.txt
bash
# 清理缓存
pip cache purge

贡献者

The avatar of contributor named as wkwbk wkwbk

页面历史