Skip to content

Commit

Permalink
添加 Ubuntu apt-get和pip源更换
Browse files Browse the repository at this point in the history
  • Loading branch information
vipstone committed May 14, 2018
1 parent 596d134 commit d2d7c80
Show file tree
Hide file tree
Showing 4 changed files with 49 additions and 3 deletions.
4 changes: 3 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,9 @@

# 相关文档 #

[pip/pip3更换国内源](doc/pipChange.md)
[Ubuntu apt-get和pip源更换](doc/ubuntuChange.md)

[pip/pip3更换国内源——Windows版](doc/pipChange.md)

[OpenCV添加中文](doc/chinese.md)

Expand Down
2 changes: 1 addition & 1 deletion doc/pipChange.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# pip/pip3更换国内源 #
# pip/pip3更换国内源——Windows版 #

用途:pip更换为国内源,可以大大的提高安装成功率和速度。

Expand Down
2 changes: 1 addition & 1 deletion doc/settingup.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# 环境搭建
# 环境搭建 #

环境搭建为OpenCV的python(一下简称py)开发环境搭建,建立在py3的环境和语法上实现的。

Expand Down
44 changes: 44 additions & 0 deletions doc/ubuntuChange.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
# Ubuntu apt-get和pip源更换 #

更新数据源为国内,是为了加速安装包的增加速度。


# 更换apt-get数据源 #

1. 输入:sudo -s切换为root超级管理员;
2. 执行命令:vim /etc/apt/sources.list;
1. 使用命令:%d 清空所有内容;
1. 清华数据源地址:https://mirrors.tuna.tsinghua.edu.cn/help/ubuntu/ 选择相应的版本复制内容,点击“i”键进入编辑文本模式,粘贴内容到vim编辑窗体,点击“ESC”键进入编辑模式,输入“:wq”保存离开;
2. 更新源:sudo apt-get update;
3. 更新软件:sudo apt-get upgrade;


# pip3的安装与升级 #
安装pip3:sudo apt-get install python3-pip

升级pip3:sudo pip install --upgrade pip

查看pip版本:pip -V


# pip源更换 #

1. 根目录创建.pip文件:mkdir ~/.pip;
1. 创建文件pip.conf:vim .pip/pip.conf;
1. 点击“i”键,进入编辑模式,复制信息:
```
[global]
index-url = https://pypi.tuna.tsinghua.edu.cn/simple
trusted-host = pypi.tuna.tsinghua.edu.cn
```
这个更换的是清华的源,清华的源5分钟同步官网一次,建议使用。
清华大学 https://pypi.tuna.tsinghua.edu.cn/simple/
阿里云 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/

1. 点击:“ESC”切换到命令行模式,输入“:wq”保存离开。



0 comments on commit d2d7c80

Please sign in to comment.