Only use wheels compatible with Python implementation , e.g. ‘pp’, ‘jy’, ‘cp’, or ‘ip’. If not specified, then the current interpreter implementation is used. Use ‘py’ to force implementation-agnostic wheels.
--abi <abi>
Only use wheels compatible with Python abi , e.g. ‘pypy_41’. If not specified, then the current interpreter abi tag is used. Generally you will need to specify --implementation, --platform, and --python-version when using this option.
--root <dir>
Install everything relative to this alternate root directory.
--prefix <dir>
Installation prefix where lib, bin and other top-level folders are placed
--src <dir>
Directory to check out editable projects into. The default in a virtualenv is “/src”. The default for global installs is “/src”.
-U
--upgrade
升级所有指定的包到最新版本
--upgrade-strategy <upgrade_strategy>
Determines how dependency upgrading should be handled [default: only-if-needed]. “eager” - dependencies are upgraded regardless of whether the currently installed version satisfies the requirements of the upgraded package(s). “only-if-needed” - are upgraded only when they do not satisfy the requirements of the upgraded package(s).
--force-reinstall
Reinstall all packages even if they are already up-to-date.
-I, --ignore-installed
Ignore the installed packages (reinstalling instead).
--ignore-requires-python
Ignore the Requires-Python information.
...
# 使用示例
pip install <package_name>
3、pip uninstall 卸载包
短格式
长格式
描述
-r
--requirement
卸载所有指定的包
-y
--yes
无需确认
4、pip list 列出包
短格式
长格式
描述
-o
--outdated
列出过期的包
-u
--uptodate
列出已更新完成的包
-e
--editable
列出可编辑的项目
-l
--local
如果在虚拟环境中,不列出全局包
--user
仅列出当前用户的目录下的包
--path <path>
列出指定位置的包,可指定多个位置
--pre
预览版、开发版包也列出
--format <list_format>
指定列出的格式:columns(默认)、freeze、json
5、pip show列出包信息
# 列出和包相关的文件
pip show <package_name>-f
pip show <package_name>--files