apt更新源
编辑/etc/apt/sources-list
deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ xenial main restricted
deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ xenial-updates main restricted
deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ xenial universe
deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ xenial-updates universe
deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ xenial multiverse
deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ xenial-updates multiverse
deb 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
deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ xenial-security universe
deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ xenial-security multiverse
pip更新源
在用户目录下创建.pip文件夹,并创建pip.conf文件
[global]
trusted-host = pypi.mirrors.ustc.edu.cn
index-url = https://pypi.mirrors.ustc.edu.cn/simple
或者
[global]
index-url = http://mirrors.aliyun.com/pypi/simple
[install]
trusted-host=mirrors.aliyun.com