ubuntu更换pip install,apt-get,conda install 成国内源
解决ubuntu的pip和apt-get太慢的问题
ubuntu国外龟速的源实在难受,还是自己动手更改一下各种pip 源和apt-get 的源吧,换了之后速度令人舒适!
更换pip源成清华源
临时使用:
可以在使用pip的时候加参数-i https://pypi.tuna.tsinghua.edu.cn/simple例如
pip install opencv-python -i https://pypi.tuna.tsinghua.edu.cn/simple
这样就从清华这边的镜像去安装opencv-python
永久修改
linux下,修改 ~/.pip/pip.conf (没有就创建一个), 修改 index-url至清华源,内容如下:
[global]
index-url = https://pypi.tuna.tsinghua.edu.cn/simple
windows下,找到 C:\Users\xxx(自己名字)\AppData\Roaming\pip,新建文件pip.ini,内容如下
[global]
index-url = https://pypi.tuna.tsinghua.edu.cn/simple
更换apt-get成清华源
原文件备份(万一更换的源不行的时候,复制回来)
sudo cp /etc/apt/sources.list /etc/apt/sources.list.bak
编辑源列表文件
sudo vim /etc/apt/sources.list
将原来的列表删除,添加清华镜像源(https://mirrors.tuna.tsinghua.edu.cn/help/ubuntu/)
# 默认注释了源码镜像以提高 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
sudo apt-get update 让更改生效
更换conda install源成清华源
编辑源列表文件
gedit ~/.condarc
删除文件内容,替换默认源成清华源
channels:
- https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/free/
- defaults
show_channel_urls: yes
ubuntu更换pip install,apt-get,conda install 成国内源的更多相关文章
- ubuntu更换pip源
1.创建pip.conf文件 cd ~/.pip 当提示不存在时,创建它 mkdir ~/.pip 在.pip目录下创建一个pip.conf文件 touch pip.conf 2.编辑pip.conf ...
- 【转载】 180623 Conda install 本地压缩包文件tar.bz2
原文地址“ https://blog.csdn.net/qq_33039859/article/details/80785535 ----------------------------------- ...
- conda、pip换源以及conda、pip命令比较
conda换源: conda config --add channels https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/free/ conda ...
- sudo apt-get install 、 pip install和conda install的对比
sudo apt-get install: apt-get可以用来安装软件.更新源,也可以用来更新自Ubuntu的典型依赖包. (sudo apt-get remove --purge 软件名称 su ...
- conda install和pip install区别
conda ≈ pip(python包管理) + virtualenv(虚拟环境) + 非python依赖包管理 级别不一样conda和yum比较类似,可以安装很多库,不限于Python.conda是 ...
- ubuntu 装tensorflow出现 conda install ERROR missing write permission错误
通过搜索tensorflow然后运行,例如:$ conda install --channel https://conda.anaconda.org/jjh_cio_testing tensorflo ...
- ubuntu conda install ERROR missing write permission错误
报错: ondaIOError: Missing write permissions in: /usr/local/anaconda3 # # You don't appear to have the ...
- conda install 出错
在下载包时出现下面的错误: userdeMBP:pytorch user$ conda install -n deeplearning matplotlib Solving environment: ...
- Ubuntu无法安装rpm包,ubuntu RPM should not be used directly install RPM packages, use Alien instead!
Ubuntu无法安装rpm包,ubuntu RPM should not be used directly install RPM packages, use Alien instead! 简单来说, ...
随机推荐
- H3C WAP712C 路由器设置
0.做完任何设置之后都要执行保存操作,否则断电后设置会丢失! 1.默认登录参数:IP:192.168.0.50ID:adminPD:h3capadmin 2.修改默认IP地址:设备 --> 接口 ...
- Gym - 101982C Contest Setting (动态规划)
A group of contest writers have written n problems and want to use k of them in an upcoming contest. ...
- IntelliJ IDEA 2017新工具
IntelliJ IDEA 2017 教程之概述 图文详解如何安装 Intellij IDEA 2017 深入剖析 IntelliJ IDEA 2017 的目录结构 图文详解如何配置 IntelliJ ...
- C++回顾day03---<string字符串操作>
一:string优点 相比于char*的字符串,C++标准程序库中的string类不必担心内存是否足够.字符串长度等等 而且作为一个类出现,他集成的操作函数足以完成我们大多数情况下的需要. 二:str ...
- HDU 1228(字符串处理)
题意是将所给算式求出结果. 用的方法非常麻烦,开始没考虑到零也需要处理,以为遇上零直接跳过即可,知道发现零可以占位,比如 one zero 值为 10 而不是 1…… 代码如下: #include & ...
- UNIX域协议之描述符传递
一.mycat程序 #include <fcntl.h> #include <stdlib.h> #include <unistd.h> #define BUFFS ...
- print number
# -*- coding: utf-8 -*-"""------------------------------------------------- File Name ...
- DUMP 5 企业级电商项目
[订单模块] 创建订单 商品信息 订单列表 订单详情 取消订单 订单列表 订单搜素 订单详情 订单发货 [创建订单] 购物车勾选商品 涉及 Cart Product => 一个商品 ...
- DES加密ECB(模式) golang
Java默认DES算法使用DES/ECB/PKCS5Padding,而golang认为这种方式是不安全的,所以故意没有提供这种加密方式,那如果我们还是要用到怎么办?下面贴上golang版的DES EC ...
- Android Studio安装后配置默认新工程目录以及.gradle,.android,.m2和system,config目录
关于在哪里设置:以下所有设置都是在没有打开工程的前提下设置的, Configure > Settings 如图: 不要使用 Configure > Project Defaults> ...