PIP和conda 更换国内安装源的方法步骤
conda 更换国内安装源
全局
Anaconda 是一个用于科学计算的 Python 发行版,支持 Linux, Mac, Windows, 包含了众多流行的科学计算、数据分析的 Python 包。
Anaconda 安装包可以到 https://mirrors.tuna.tsinghua.edu.cn/anaconda/archive/ 下载。
TUNA 还提供了 Anaconda 仓库与第三方源(conda-forge、msys2、pytorch等,查看完整列表)的镜像,各系统都可以通过修改用户目录下的 .condarc 文件。Windows 用户无法直接创建名为 .condarc 的文件,可先执行 conda config --set show_channel_urls yes 生成该文件之后再修改。
注:由于更新过快难以同步,我们不同步pytorch-nightly, pytorch-nightly-cpu, ignite-nightly这三个包。
channels: - defaults show_channel_urls: true channel_alias: https://mirrors.tuna.tsinghua.edu.cn/anaconda default_channels: - https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/main - https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/free - https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/r - https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/pro - https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/msys2 custom_channels: conda-forge: https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud msys2: https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud bioconda: https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud menpo: https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud pytorch: https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud simpleitk: https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud
即可添加 Anaconda Python 免费仓库。
运行 conda clean -i 清除索引缓存,保证用的是镜像站提供的索引。
运行 conda create -n myenv numpy 测试一下吧。
临时
安装cuda:
conda install cudatoolkit=8.0 -c https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/free/linux-64/
安装cudnn:
conda install cudnn=7.0.5 -c https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/main/linux-64/
PIP 更换国内安装源
pip国内的一些镜像
阿里云 http://mirrors.aliyun.com/pypi/simple/
中国科技大学 https://pypi.mirrors.ustc.edu.cn/simple/
豆瓣(douban) http://pypi.douban.com/simple/
中国科学技术大学 http://pypi.mirrors.ustc.edu.cn/simple/
修改源方法:
临时使用:
可以在使用pip的时候在后面加上-i参数,指定pip源
eg: pip install scrapy -i https://pypi.tuna.tsinghua.edu.cn/simple
永久修改:
linux:
修改 ~/.pip/pip.conf (没有就创建一个), 内容如下:
[global] index-url = https://pypi.tuna.tsinghua.edu.cn/simple
到此这篇关于PIP和conda 更换国内安装源的方法步骤的文章就介绍到这了,更多相关PIP和conda 更换国内安装源内容请搜索脚本之家以前的文章或继续浏览下面的相关文章希望大家以后多多支持脚本之家!
相关文章
python PIL和CV对 图片的读取,显示,裁剪,保存实现方法
今天小编就为大家分享一篇python PIL和CV对 图片的读取,显示,裁剪,保存实现方法,具有很好的参考价值,希望对大家有所帮助。一起跟随小编过来看看吧2019-08-08
基于Matplotlib 调用 pyplot 模块中 figure() 函数处理 figure图形对象
这篇文章主要介绍了基于Matplotlib 调用 pyplot 模块中 figure() 函数处理 figure图形对象,matplotlib.pyplot模块能够快速地生成图像,但如果使用面向对象的编程思想,我们就可以更好地控制和自定义图像,下面就来详细介绍其内容,需要的朋友可以参考下2022-02-02
python orm 框架中sqlalchemy用法实例详解
这篇文章主要介绍了python orm 框架中sqlalchemy用法,结合实例形式详细分析了Python orm 框架基本概念、原理及sqlalchemy相关使用技巧,需要的朋友可以参考下2020-02-02
解决python报错ImportError:urllib3 v2.0 only supports OpenSSL
这篇文章主要介绍了解决python报错ImportError:urllib3 v2.0 only supports OpenSSL 1.1.1+的相关资料,文中通过代码介绍的非常详细,需要的朋友可以参考下2023-12-12


最新评论