平时pip安装偶尔会下载速度过慢
可以使用以下网站进行下载
豆瓣:http://pypi.douban.com/simple/
清华大学:https://pypi.tuna.tsinghua.edu.cn/simple/
中国科技大学:https://pypi.mirrors.ustc.edu.cn/simple/
阿里云:https://mirrors.aliyun.com/pypi/simple/
百度:https://mirror.baidu.com/pypi/simple
假设我们需要安装名为numpy的Python包。
使用默认源安装numpy
pip install numpy
使用清华大学镜像源,重新安装numpy
pip install -i https://pypi.tuna.tsinghua.edu.cn/simple/ numpy
或者
pip install numpy -i https://pypi.tuna.tsinghua.edu.cn/simple
在电脑上安装了多个版本的Python时,确实可能需要指定特定版本的 pip
来安装包。通常,这可以通过以下几种方法实现:
1. 使用完整路径
E:\Python39\Scripts\pip.exe install package_name