1,安装pip3

sudo apt install python3-pip

验证安装是否成功

pip3 --version

guoyz@debian:~/pip-9.0.1$ pip3 --version
pip 18.1 from /usr/lib/python3/dist-packages/pip (python 3.7)

然后安装构建python 模块所需的开发工具, 

sudo  apt install build-essential python3-dev python3-setuptools

2,新建pip.conf文件

guoyanzhang@debian:~$ pwd
/home/guoyanzhang
guoyanzhang@debian:~$ mkdir .pip
guoyanzhang@debian:~$ vim .pip/pip.conf

添加内容:

[global]
index-url=http://mirrors.aliyun.com/pypi/simple/

[install]
trusted-host=mirrors.aliyun.com

​ubuntu 下安装pip3​