清华镜像地址:

https://pypi.tuna.tsinghua.edu.cn/simple

例如:

假设要安装 numpy 库,则在原来的语句上添加 -i 和镜像地址即可。

pip install numpy -i https://pypi.tuna.tsinghua.edu.cn/simple

国内源:
新版ubuntu要求使用https源,要注意。

阿里云: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/

修改镜像源:(直接在命令行输入)
conda config --add channels https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/free/
在输入:conda config --set show_channel_urls yes 就修改完成了!
在这里插入图片描述
在这里插入图片描述

永久修改:

Linux下,修改 ~/.pip/pip.conf (没有就创建一个文件夹及文件。文件夹要加“.”,表示是隐藏文件夹)。

内容如下:

[global]
index-url = https://pypi.tuna.tsinghua.edu.cn/simple
[install]
trusted-host=mirrors.aliyun.com

windows下,直接在user目录中创建一个pip目录,如:C:\Users\xx\pip,新建文件pip.ini。内容同上。

Logo

旨在为数千万中国开发者提供一个无缝且高效的云端环境,以支持学习、使用和贡献开源项目。

更多推荐