python安装pip3.6.1 installl报错_ubuntu18.04(python3.6)安装pip3报错:ImportError: cannot import name 'sysconfi...

2018年06月08日

2 评论

46 汉字

44 热度

1、错误描述

启动pip3时报错:

Traceback (most recent call last):

File "get-pip.py", line 20649, in

main()

File "get-pip.py", line 197, in main

bootstrap(tmpdir=tmpdir)

File "get-pip.py", line 82, in bootstrap

import pip._internal

File "/tmp/tmp73pg421j/pip.zip/pip/_internal/__init__.py", line 42, in

File "/tmp/tmp73pg421j/pip.zip/pip/_internal/cmdoptions.py", line 16, in

File "/tmp/tmp73pg421j/pip.zip/pip/_internal/index.py", line 25, in

File "/tmp/tmp73pg421j/pip.zip/pip/_internal/download.py", line 35, in

File "/tmp/tmp73pg421j/pip.zip/pip/_internal/locations.py", line 10, in

ImportError: cannot import name 'sysconfig'

2、解决方案:

2.1 添加源(原有基础上)

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

2.2 update更新命令

sudo apt-get update

2.3 安装pip3

sudo apt-get install python3-pip

2.4 安装distutils,解决报错问题

sudo apt-get install python3-distutils

参考文献:

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值