Ubuntu 18.04 安装 pip3

Ubuntu 18.04 默认安装了 python2.x 和 python3.x;
默认情况下 python 指的是 python2.x,如果要使用 python3.x 需要使用 python3,如:

python test.py
python3 test.py

 

同样 pip 默认也是应用于 python2.x,所以需要安装 python3.x 专属的 pip, 这样就能安装 python3.x 的类库了,安装命令如下:

sudo apt-get install python3-pip

如果出现 dpkg was interrupted 的错误,则先配置 dpkg,

sudo dpkg --configure -a

再安装 pip3

安装完后,可以查看

posted @ 2019-07-12 12:37  一菲聪天  阅读(12215)  评论(0编辑  收藏  举报