Conda和Python的国内安装源
Conda和Python的国内安装源
Windows系统:
更换python国内源的方法。
在“C:\Users[xxxx]\pip\pip.ini”文件中配置如下内容(没有则新建,xxx代表当前用户目录):
[global]
index-url = https://pypi.tuna.tsinghua.edu.cn/simple
[install]
trusted-host=mirrors.aliyun.com
更换conda的国内源的方法,终端命令输入如下:
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/main/
conda config --set show_channel_urls yes
在windows下可以修改“C:\Users[xxxx].condarc”文件如下内容:
channels:
- https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/free/
- https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/main/
- defaults
show_channel_urls: true
ssl_verify: true
换回默认源:
conda config --remove-key channels
linux系统:
更换python国内源的方法。
在“~/.pip/pip.conf”文件中配置如下内容(没有则新建).执行以下命令
cd ~ &&mkdir .pip &&cd .pip &&vim pip.conf
输入如下内容:
[global]
index-url = http://pypi.douban.com/simple
trusted-host = pypi.douban.com
更换conda的国内源的方法(同Windows系统设置)。
修改apt-get源的方法。
(1)执行如下命令,先备份,再修改“/etc/apt/sources.list”的文件:
sudo cp /etc/apt/sources.list /etc/apt/sources.list.backup
sudo vi /etc/apt/sources.list
(2)复制对应版本的源地址:https://mirror.tuna.tsinghua.edu.cn/help/ubuntu/
ubuntu 14
默认注释了源码镜像以提高 apt update 速度,如有需要可自行取消注释
# 默认注释了源码镜像以提高 apt update 速度,如有需要可自行取消注释
deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ trusty main restricted universe multiverse
# deb-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ trusty main restricted universe multiverse
deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ trusty-updates main restricted universe multiverse
# deb-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ trusty-updates main restricted universe multiverse
deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ trusty-backports main restricted universe multiverse
# deb-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ trusty-backports main restricted universe multiverse
deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ trusty-security main restricted universe multiverse
# deb-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ trusty-security main restricted universe multiverse
# 预发布软件源,不建议启用
# deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ trusty-proposed main restricted universe multiverse
# deb-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ trusty-proposed main restricted universe multiverse
ubuntu 16
# 默认注释了源码镜像以提高 apt update 速度,如有需要可自行取消注释
deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ xenial main restricted universe multiverse
# deb-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ xenial main restricted universe multiverse
deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ xenial-updates main restricted universe multiverse
# deb-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ xenial-updates main restricted universe multiverse
deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ xenial-backports main restricted universe multiverse
# deb-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ xenial-backports main restricted universe multiverse
deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ xenial-security main restricted universe multiverse
# deb-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ xenial-security main restricted universe multiverse
# 预发布软件源,不建议启用
# deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ xenial-proposed main restricted universe multiverse
# deb-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ xenial-proposed main restricted universe multiverse
(3)最后执行更新:
sudo apt-get update
Centos的yum源跟换为国内的阿里云源
(1)备份
mv /etc/yum.repos.d/CentOS-Base.repo /etc/yum.repos.d/CentOS-Base.repo.backup
(2)下载新的CentOS-Base.repo 到/etc/yum.repos.d/
CentOS 5
wget -O /etc/yum.repos.d/CentOS-Base.repo http://mirrors.aliyun.com/repo/Centos-5.repo
CentOS 6
wget -O /etc/yum.repos.d/CentOS-Base.repo http://mirrors.aliyun.com/repo/Centos-6.repo
CentOS 7
wget -O /etc/yum.repos.d/CentOS-Base.repo http://mirrors.aliyun.com/repo/Centos-7.repo
3、运行生成缓存
yum makecache
Conda和Python的国内安装源的更多相关文章
- 【Python】pip国内安装源
豆瓣安装源 pip install packages -i http://pypi.doubanio.com/simple --upgrade --trusted-host pypi.doubanio ...
- python指定pip安装源
python的pip默认的安装源的位置是国外的,导致有时候下载很慢或者直接失败我们可以切换国内的源 目前国内可用的我知道的有两个 豆瓣的:http://pypi.doubanio.com/simple ...
- python pip 更换国内安装源(windows)
1.点击此电脑,在最上面的的文件夹窗口输入 : %APPDATA% 2.按回车跳转到以下目录,新建pip文件夹 3.创建pip.ini文件 4.打开文件夹,输入以下内容,关闭即可(注意:源镜像可替换) ...
- Pycharm软件更换pip默认安装源为国内安装源
1.为什么这么做? Python里的pip是官方自带的源,国内使用pip安装的时候十分缓慢,所以最好是更换成中国国内的源地址. 2.准备工作: 目前国内靠谱的 pip 镜像源有: 清华: https: ...
- Python 更换国内pip源
pip国内的一些镜像: 阿里云 http://mirrors.aliyun.com/pypi/simple/ 中国科技大学 https://pypi.mirrors.ustc.edu.cn/sim ...
- pip3的国内安装源
1,清华源 pip3 install -i https://pypi.tuna.tsinghua.edu.cn/simple virtualen 2,豆瓣源 pip3 install -i https ...
- PYTHON指定国内PIP源
一.LINUX: vi ~/.pip/pip.conf 输入内容: [global]index-url = http://pypi.douban.com/simple/[install]trusted ...
- PIP 更换国内安装源
linux: 修改 ~/.pip/pip.conf (没有就创建一个), 内容如下: [global] index-url = https://pypi.tuna.tsinghua.edu.cn/si ...
- Python: 解决pip安装源被墙的问题
pip install <package> -i http://mirrors.aliyun.com/pypi/simple --trusted-host mirrors.aliyun.c ...
随机推荐
- Java Web 学习(4) —— Spring MVC 概览
Spring MVC 概览 一. Spring MVC Spring MVC 是一个包含了 Dispatcher Servlet 的 MVC 框架. Dispatcher Servlet 实现了 : ...
- jQuery的延迟对象(十一)
在前端这个领域里面,ajax请求非常常见. // 前提引入jquery $.ajax({ type: 'get', url: '/path/to/data', success: function (r ...
- HTML连载50-伪元素选择器、清除浮动方式五
一.伪元素选择器 1.什么是伪元素选择器 伪元素选择器作用给指定标签的内容前面添加一个子元素,或者给指定标签的内容后面添加一个子元素. 2.格式: 标签名称::before{ 属性名称:值: } 给指 ...
- 使用layer.msg 时间设置不起作用
前几天使用layer.msg设置时间后发现不起作用,这里记录一下. 开始出错误的代码: 后面查看文档后得知调用layer.msg后如果有后续操作需要写在function()中: //eg1 layer ...
- python-12-字典的嵌套与int快速排序
前言 字典的增删改查我们都有一定的认识与了解啦,但是字典也可以嵌套列表.字典.元组等数据结构. 一.字典的嵌套 1.修改.添加 dic = { "name": ["lin ...
- plsql基础练习题
1.键盘输入一个年份,判断是否是闰年; (能被4整除而不能被100整除或者能被100和400同时整除,满足其一即可); 方法1 declare v_year number(4):=&请输入一个 ...
- C++入门到理解阶段二基础篇(6)——C++数组
概述 C++ 支持数组数据结构,它可以存储一个固定大小的相同类型元素的顺序集合.数组是用来存储一系列数据,但它往往被认为是一系列相同类型的变量. 数组的声明并不是声明一个个单独的变量,比如 numbe ...
- MySQL-8.0.x DDL 原子性
[1.mysql-8.0.x 新特性之 DDL 原子性] 在没有 DDL 原子性之前 DBA 对 DDL 语句基本上是无能为力的,比如说 DDL 执行的过程中停电了,这下就只有天知道了.实现上最终的愿 ...
- 湖南省web应用软件(中慧杯)
湖南省web应用软件 写这篇博客已经是比完赛的第四天了,我还记得那天下着小雨.我们早早的到了比赛的现场抽检机器,在比赛前一天我很是激动.我还记得我们从学校,去株洲的时候我们的领导来给我加油,特别是我的 ...
- 对RESTful Api的简单记录
1.五个动词 ①GET:读取(Read)--->查询操作 ②POST:新建(Create)--->添加操作 ③PUT:更新(Update)--->修改操作 ④PATCH:更新(Upd ...