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
Ubuntu 18.04 安装 pip3
安装完后,可以查看
Ubuntu 18.04 安装 pip3

相关文章:

  • 2021-08-18
  • 2021-05-22
  • 2022-01-13
  • 2021-11-24
  • 2021-06-11
  • 2021-08-20
  • 2021-08-05
  • 2021-07-14
猜你喜欢
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-12-05
  • 2021-12-19
相关资源
相似解决方案