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 ...
随机推荐
- go语言设计模式之observer
observer.go package observer import ( "fmt" ) type Observer interface { Notify(string) } t ...
- 【1期】mysql必知必会
再有人问你为什么MySQL用B+树做索引,就把这篇文章发给她
- linux 头文件路径
linux 头文件路径 /usr/include
- python接口测试:如何将A接口的返回值传递给B接口
在编写接口测试脚本时,要考虑一个问题:参数值从哪里获取 一种方式是可以通过数据库来获取,但是通过这次接口测试,我发现读取数据库有一个缺点:速度慢 可能和我的sql写法有关,有些sql加的约束条件比较少 ...
- Python连载53-UDP、TCP、FTP编程实例
一.服务器程序要求永远运行,一般用死循环来处理 1.服务器改造版本V03(主程序 原封不动,这里只修改了运行的程序) if __name__ == "__main__": whil ...
- 1+x 证书 Web 前端开发初级理论考试(试卷8 )
Web前端开发初级模拟测试卷(三) 共55道题 总分:200分 形考总分:0分 一.单选题共30题,60分 1.实现向右的红色三角形,样式实现正确的是( ) A <div class=" ...
- 11-Django站点管理
站点管理 内容发布的部分由网站的管理员负责,包括查看.添加.修改.删除数据 开发这些重复的功能是一件单调乏味.缺乏创造力的工作,为此,Django能够根据定义的模型类自动地生成管理模块 在Django ...
- 基础面试,为什么面试官总喜欢问String?
关于 Java String,这是面试的基础,但是还有很多童鞋不能说清楚,所以本文将简单而又透彻的说明一下那个让你迷惑的 String 在 Java 中,我们有两种方式创建一个字符串 String x ...
- Netty - 粘包和半包(下)
上一篇介绍了粘包和半包及其通用的解决方案,今天重点来看一下 Netty 是如何实现封装成帧(Framing)方案的. 解码核心流程 之前介绍过三种解码器FixedLengthFrameDecoder. ...
- arcgis api for javascript 学习(六) 地图打印
1.本文应用arcgis api for javascript对发布的动态地图进行打印,打印的为PDF格式,打印出来如图: 2.需要特别注意的是:我们在运行代码前,需要打开PrintingTools, ...