库包安装
- 直接使用命令安装
pip install package_name
- 指定安装包
pip instal package_name==x.x.x
- 临时使用镜像源安装
pip intall package_name -i https://pypi.tuna.tsinghua.edu.cn/simple
配置镜像源
- 常用镜像源
清华:https://pypi.tuna.tsinghua.edu.cn/simple
阿里云:http://mirrors.aliyun.com/pypi/simple/
中国科技大学 https://pypi.mirrors.ustc.edu.cn/simple/
华中理工大学:http://pypi.hustunique.com/
山东理工大学:http://pypi.sdutlinux.org/
豆瓣:http://pypi.douban.com/simple/
手动使用镜像源
pip intall package_name -i https://pypi.tuna.tsinghua.edu.cn/simple
永久配置镜像源(Windows | MAC)同理
- 在终端执行命令
pip config set global.index-url https://pypi.tuna.tsinghua.edu.cn/simple
- 响应
- 将
C:\Users\zh\AppData\Roaming\pip\pip.ini
配置到Windows环境变量PATH
中
到此就可以正常使用国内镜像源安装库包使用了
`