新系统部署python环境需要做的几件事(一)

作者: localhost 分类: Linux 发布时间: 2018-04-19 11:07
通常ubuntu下已经存在python2.7和python3的环境所以不需要再次安装, 本篇内容主要介绍ubuntu下 系统环境的基本设置 PS:centos7 安装 python3可以参考文章 新系统部署python环境需要做的几件事(二)

1.更新系统

sudo apt-get update

2.更换源为阿里云

  • 1.备份source.list
>sudo cp /etc/apt/sources.list /etc/apt/sources.list.old
  • 2.修改并复制阿里云source源
> sudo vim /etc/apt/source.list
#或者
> sudo gedit /etc/apt/source.list
#复制如下源并修改
# deb cdrom:[Ubuntu 16.04 LTS _Xenial Xerus_ - Release amd64 (20160420.1)]/ xenial main restricted
deb-src http://archive.ubuntu.com/ubuntu xenial main restricted #Added by software-properties
deb http://mirrors.aliyun.com/ubuntu/ xenial main restricted
deb-src http://mirrors.aliyun.com/ubuntu/ xenial main restricted multiverse universe #Added by software-properties
deb http://mirrors.aliyun.com/ubuntu/ xenial-updates main restricted
deb-src http://mirrors.aliyun.com/ubuntu/ xenial-updates main restricted multiverse universe #Added by software-properties
deb http://mirrors.aliyun.com/ubuntu/ xenial universe
deb http://mirrors.aliyun.com/ubuntu/ xenial-updates universe
deb http://mirrors.aliyun.com/ubuntu/ xenial multiverse
deb http://mirrors.aliyun.com/ubuntu/ xenial-updates multiverse
deb http://mirrors.aliyun.com/ubuntu/ xenial-backports main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ xenial-backports main restricted universe multiverse #Added by software-properties
deb http://archive.canonical.com/ubuntu xenial partner
deb-src http://archive.canonical.com/ubuntu xenial partner
deb http://mirrors.aliyun.com/ubuntu/ xenial-security main restricted
deb-src http://mirrors.aliyun.com/ubuntu/ xenial-security main restricted multiverse universe #Added by software-properties
deb http://mirrors.aliyun.com/ubuntu/ xenial-security universe
deb http://mirrors.aliyun.com/ubuntu/ xenial-security multiverse
  • 3.更新系统
sudo apt-get update

3.修改Python的pip源为阿里云

#修改pip文件
vi ~/.pip/pip.conf
#添加如下配置
[global]
trusted-host =  mirrors.aliyun.com
index-url = http://mirrors.aliyun.com/pypi/simple
下一篇将介绍centos 7 下安装python3环境

如果觉得我的文章对您有用,请随意打赏。您的支持将鼓励我继续创作!

发表评论

电子邮件地址不会被公开。 必填项已用*标注