pip 常用命令

pip含义

Python包管理工具

pip is the package installer for Python. You can use it to install packages from the Python Package Index and other indexes.

pip install 包名

安装包
pip install flask==1.1.0 指定安装版本
pip install -i http://mirrors.aliyun.com/pypi/simple/ flask 指定镜像地址下载,国内会快一些
pip install -r requirement.txt 一次操作安装文件中所有的包

Install packages from:
PyPI (and other indexes) using requirement specifiers.
VCS project urls.
Local project directories.
Local or remote source archives.
pip also supports installing from “requirements files”, which provide an easy way to specify a whole environment to be installed.

pip uninstall 包名

卸载包
pip uninstall -r requirement.txt 卸载文件中所有的包

pip list

列出已安装的第三方包,还有版本号

List installed packages, including editables.
Packages are listed in a case-insensitive sorted order.

pip freeze

pip freeze > requirements.txt 将安装包及版本号 输出到 文档中 便于 项目部署安装环境使用

Output installed packages in requirements format.
packages are listed in a case-insensitive sorted order.

你可能感兴趣的:(pip 常用命令)