python cannot import name 'sysconfig' from 'distutils'

image

环境

  • Ubuntu 18.04
  • Python 3.8.2

错误

2020-03-25_5e7b2231a391a.png

查看pip版本的时候,执行pip -V
报错cannot import name 'sysconfig' from 'distutils'

解决

  • 添加源(原有基础上)
sudo vim /etc/apt/sources.list
  • 把下面的内容插入到sources.list中去
deb http://cn.archive.ubuntu.com/ubuntu bionic main multiverse restricted universe
deb http://cn.archive.ubuntu.com/ubuntu bionic-updates main multiverse restricted universe
deb http://cn.archive.ubuntu.com/ubuntu bionic-security main multiverse restricted universe
deb http://cn.archive.ubuntu.com/ubuntu bionic-proposed main multiverse restricted universe
  • update更新命令
sudo apt-get update
  • 安装pip3
sudo apt-get install python3-pip

成功

2020-03-25_5e7b274f316b9.png

再次查看pip版本,可以看到正常返回pip版本信息

最后编辑于
©著作权归作者所有,转载或内容合作请联系作者
【社区内容提示】社区部分内容疑似由AI辅助生成,浏览时请结合常识与多方信息审慎甄别。
平台声明:文章内容(如有图片或视频亦包括在内)由作者上传并发布,文章内容仅代表作者本人观点,简书系信息发布平台,仅提供信息存储服务。

相关阅读更多精彩内容

友情链接更多精彩内容