pip是Python包管理工具。提供了对Python包的查找、下载、安装、卸载的功能。pip已内置于Python3.4和2.7及以上版本,其他版本需要另行安装
pip安装第三方库
- pip install package_name
- pip install package_name==版本号 安装指定版本的包
- pip install package_name -i https://pypi.doubanio.com/simple/ 使用国内源(豆瓣)安装第三方库
升级
pip install -U package_name
pip install -U package_name==版本号 升级到指定的版本
查看目前安装了哪些库
pip list
升级pip命令
python -m pip install --upgrade pip
常用国内源:
1豆瓣 https://pypi.douban.com/simple
2清华大学https://pypi.tuna.tsinghua.edu.cn/simple
3阿里云 https://mirrors.aliyun.com/pypi/simple
4中国科技大学 https://pypi.mirrors.ustc.edu.cn/simple