[ 个人推荐清华大学pypi镜像站(https://mirrors.tuna.tsinghua.edu.cn/help/pypi/),每五分钟同步一次,资源丰富,下载速度很快 ] :
清华大学:http://pypi.tuna.tsinghua.edu.cn/simple
阿里云:http://mirrors.aliyun.com/pypi/simple/
豆瓣:http://pypi.douban.com/simple/
pip install -i http://pypi.douban.com/simple/ numpy #如果上一个提示不受信任,就使用这个,此参数“--trusted-host”表示信任 pip install -i http://pypi.douban.com/simple/--trusted-host pypi.douban.com
进入相应目录下 C盘->Users/用户->xxx->新建pip文件夹
进入pip文件夹->新建pip.ini文件
进入pip.ini文件,并添加配置如下:(清华源)
[global] index-url = http://pypi.tuna.tsinghua.edu.cn/simple [install] trusted-host = http://pypi.tuna.tsinghua.edu.cn # trusted-host 此参数是为了避免麻烦,否则使用的时候可能会提示不受信任
修改完成后保存,启动cmd,使用 " pip install xxx "(xxx为你要下载的包名),即可默认使用国内源下载。
切换目录,并新建 .pip 文件夹
cd ~/.pip mkdir ~/.pip
进入 .pip 文件夹,并新建 pip.conf 文件
cd ~/.pip touch pip.conf
在 pip.conf 文件中添加配置
vi pip.conf ==>(添加信息) [global] index-url = http://pypi.tuna.tsinghua.edu.cn/simple [install] trusted-host = http://pypi.tuna.tsinghua.edu.cn # trusted-host 此参数是为了避免麻烦,否则使用的时候可能会提示不受信任
保存退出即可,然后下载你需要的资源。