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的国内安装源的更多相关文章

  1. 【Python】pip国内安装源

    豆瓣安装源 pip install packages -i http://pypi.doubanio.com/simple --upgrade --trusted-host pypi.doubanio ...

  2. python指定pip安装源

    python的pip默认的安装源的位置是国外的,导致有时候下载很慢或者直接失败我们可以切换国内的源 目前国内可用的我知道的有两个 豆瓣的:http://pypi.doubanio.com/simple ...

  3. python pip 更换国内安装源(windows)

    1.点击此电脑,在最上面的的文件夹窗口输入 : %APPDATA% 2.按回车跳转到以下目录,新建pip文件夹 3.创建pip.ini文件 4.打开文件夹,输入以下内容,关闭即可(注意:源镜像可替换) ...

  4. Pycharm软件更换pip默认安装源为国内安装源

    1.为什么这么做? Python里的pip是官方自带的源,国内使用pip安装的时候十分缓慢,所以最好是更换成中国国内的源地址. 2.准备工作: 目前国内靠谱的 pip 镜像源有: 清华: https: ...

  5. Python 更换国内pip源

    pip国内的一些镜像: 阿里云 http://mirrors.aliyun.com/pypi/simple/   中国科技大学 https://pypi.mirrors.ustc.edu.cn/sim ...

  6. pip3的国内安装源

    1,清华源 pip3 install -i https://pypi.tuna.tsinghua.edu.cn/simple virtualen 2,豆瓣源 pip3 install -i https ...

  7. PYTHON指定国内PIP源

    一.LINUX: vi ~/.pip/pip.conf 输入内容: [global]index-url = http://pypi.douban.com/simple/[install]trusted ...

  8. PIP 更换国内安装源

    linux: 修改 ~/.pip/pip.conf (没有就创建一个), 内容如下: [global] index-url = https://pypi.tuna.tsinghua.edu.cn/si ...

  9. Python: 解决pip安装源被墙的问题

    pip install <package> -i http://mirrors.aliyun.com/pypi/simple --trusted-host mirrors.aliyun.c ...

随机推荐

  1. java8-14-时间API

    原来的时间类  1.默认值 我们使用起来不方便 2.在不同包 不规范   在java.util和java.sql的包中都有日期类,此外用于格式化和解析的类在java.text包中定义 3.可变  线程 ...

  2. 关于jvm的常识介绍

    1.关于jvm的组成(只介绍1.8,以前的版本不多介绍) vm stack,native method stack,program counter register,heap,metaspace 2. ...

  3. vue自定义指令笔记

    https://cn.vuejs.org/v2/guide/custom-directive.html 在vue中,有时候我们会把抽象的方法封装为一个自定义指令,多个地方共用 比如:拖拽指令 < ...

  4. 古来月Beta阶段博客报告

    Scrum会议 第十一周会议 https://www.cnblogs.com/ouc-xxxxxx/p/12014345.html 第十周会议 https://www.cnblogs.com/ouc- ...

  5. Python gc

    Python gc Python gc 模块提供垃圾回收器的接口 关于 Python 垃圾回收 <- 点击查看 官方文档:https://docs.python.org/3/library/gc ...

  6. Python 爬虫介绍,什么是爬虫,如何学习爬虫?

    ​ 作为程序员,相信大家对“爬虫”这个词并不陌生,身边常常会有人提这个词,在不了解它的人眼中,会觉得这个技术很高端很神秘.不用着急,我们的爬虫系列就是带你去揭开它的神秘面纱,探寻它真实的面目. 爬虫是 ...

  7. 添加Chrome插件时出现“程序包无效”等问题的解决办法

    相较之各大浏览器,我最喜欢的便是Chrome了,不只因为Chrome搜索,也因为Google Chrome强大的插件功能. 而这一切的东风,就是"谷歌访问助手". 谷歌访问助手的下 ...

  8. HikariCP监控指标介绍和应用

    概述 HikariCP提供了一些监控指标,他的监控指标都是基于MicroMeter提供出来的,然后支持Prometheus和Dropwizard.本次我们将讨论一下HikariCp的监控指标有哪些,为 ...

  9. css 行内水平均等排布方式

    <div class="justify"> <span>测试1</span> <span>测试2</span> < ...

  10. Python中最常用的字符串方法!

    字符串是字符序列.Python中内置的string类代表基于Unicode国际字符集的字符串.除了Python中常见的操作外,字符串还有一些专属于它们的附加方法.下图显示了所有这些可用的方法: Pyt ...