pipPython 包安装和管理工具

联合创作 · 2023-10-01 12:20

pip 是一个 Python 包安装与管理工具。

PyPI安装软件包:

$ pip install SomePackage
[...]
Successfully installed SomePackage

安装已经从PyPI下载或从其他地方获得的软件包:

$ pip install SomePackage-1.0-py2.py3-none-any.whl
[...]
Successfully installed SomePackage

显示安装了哪些文件:

$ pip show --files SomePackage
Name: SomePackage
Version: 1.0
Location: /my/env/lib/pythonx.x/site-packages
Files:
  ../somepackage/__init__.py
  [...]

列出哪些软件包已过期:

$ pip list --outdated
SomePackage (Current: 1.0 Latest: 2.0)

升级软件包:

$ pip install --upgrade SomePackage
[...]
Found existing installation: SomePackage 1.0
Uninstalling SomePackage:
  Successfully uninstalled SomePackage
Running setup.py install for SomePackage
Successfully installed SomePackage

卸载软件包:

$ pip uninstall SomePackage
Uninstalling SomePackage:
  /my/env/lib/pythonx.x/site-packages/somepackage
Proceed (y/n)? y
Successfully uninstalled SomePackage
浏览 22
点赞
评论
收藏
分享

手机扫一扫分享

编辑 分享
举报
评论
图片
表情
推荐
点赞
评论
收藏
分享

手机扫一扫分享

编辑 分享
举报