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

安装完后,可以查看


免责声明!

本站转载的文章为个人学习借鉴使用,本站对版权不负任何法律责任。如果侵犯了您的隐私权益,请联系本站邮箱yoyou2525@163.com删除。



 
粤ICP备18138465号  © 2018-2025 CODEPRJ.COM