1.pip
1.临时使用:(这里以opencv-python joblib包为例,并使用清华镜像源,并且后面的地址就是清华镜像源地址)
pip install opencv-python joblib -i https://pypi.tuna.tsinghua.edu.cn/simple
2.永久配置:
输入以下代码即可
pip config set global.index-url https://pypi.tuna.tsinghua.edu.cn/simple
2.conda
您可以先通过以下代码查看您的镜像源:
conda config --show channels
接下来运行以下代码即可添加清华镜像源
conda config --add channels https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/main
conda config --add channels https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/free
conda config --add channels https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/r
conda config --add channels https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/pro
conda config --add channels https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/msys2
此外,您如果想删除添加源,恢复默认源,运行以下代码即可
conda config --remove-key channels
3.其他镜像源
清华大学开源软件镜像站:https://pypi.tuna.tsinghua.edu.cn/simple
阿里云开源镜像站:https://mirrors.aliyun.com/pypi/simple/
中国科技大学 https://pypi.mirrors.ustc.edu.cn/simple/
如果您觉得文章还不错,请大家点赞、分享、留言下,因为这将是我持续输出更多优质文章的最强动力!