pip安装报错ModuleNotFoundError: No module named 'distutils.util'

wyao@DESKTOP-43885PP:~$ python3 get-pip.py
Traceback (most recent call last):
  File "get-pip.py", line 22711, in 
    main()
  File "get-pip.py", line 198, in main
    bootstrap(tmpdir=tmpdir)
  File "get-pip.py", line 82, in bootstrap
    from pip._internal.cli.main import main as pip_entry_point
  File "/tmp/tmpf7n40dj4/pip.zip/pip/_internal/cli/main.py", line 10, in 
  File "/tmp/tmpf7n40dj4/pip.zip/pip/_internal/cli/autocompletion.py", line 9, in 
  File "/tmp/tmpf7n40dj4/pip.zip/pip/_internal/cli/main_parser.py", line 7, in 
  File "/tmp/tmpf7n40dj4/pip.zip/pip/_internal/cli/cmdoptions.py", line 19, in 
ModuleNotFoundError: No module named 'distutils.util'

安装python3-distutils后

重新安装成功秒杀

wyao@DESKTOP-43885PP:~$ sudo apt-get install python3-distutils
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following additional packages will be installed:
  python3-lib2to3
The following NEW packages will be installed:
  python3-distutils python3-lib2to3
0 upgraded, 2 newly installed, 0 to remove and 0 not upgraded.
Need to get 222 kB of archives.
After this operation, 3143 kB of additional disk space will be used.
Do you want to continue? [Y/n] y
Get:1 https://mirrors.tuna.tsinghua.edu.cn/ubuntu bionic-updates/main amd64 python3-lib2to3 all 3.6.9-1~18.04 [77.4 kB]
Get:2 https://mirrors.tuna.tsinghua.edu.cn/ubuntu bionic-updates/main amd64 python3-distutils all 3.6.9-1~18.04 [144 kB]
Fetched 222 kB in 1s (198 kB/s)
Selecting previously unselected package python3-lib2to3.
(Reading database ... 29243 files and directories currently installed.)
Preparing to unpack .../python3-lib2to3_3.6.9-1~18.04_all.deb ...
Unpacking python3-lib2to3 (3.6.9-1~18.04) ...
Selecting previously unselected package python3-distutils.
Preparing to unpack .../python3-distutils_3.6.9-1~18.04_all.deb ...
Unpacking python3-distutils (3.6.9-1~18.04) ...
Setting up python3-lib2to3 (3.6.9-1~18.04) ...
Setting up python3-distutils (3.6.9-1~18.04) ...
wyao@DESKTOP-43885PP:~$ python3 get-pip.py
Defaulting to user installation because normal site-packages is not writeable
Collecting pip
  Downloading pip-20.0.2-py2.py3-none-any.whl (1.4 MB)
     |████████████████████████████████| 1.4 MB 11 kB/s
Collecting setuptools
  Downloading setuptools-46.1.3-py3-none-any.whl (582 kB)
     |████████████████████████████████| 582 kB 13 kB/s
Collecting wheel
  Downloading wheel-0.34.2-py2.py3-none-any.whl (26 kB)
Installing collected packages: pip, setuptools, wheel
  WARNING: The scripts pip, pip3 and pip3.6 are installed in '/home/wyao/.local/bin' which is not on PATH.
  Consider adding this directory to PATH or, if you prefer to suppress this warning, use --no-warn-script-location.
  WARNING: The scripts easy_install and easy_install-3.6 are installed in '/home/wyao/.local/bin' which is not on PATH.
  Consider adding this directory to PATH or, if you prefer to suppress this warning, use --no-warn-script-location.
  WARNING: The script wheel is installed in '/home/wyao/.local/bin' which is not on PATH.
  Consider adding this directory to PATH or, if you prefer to suppress this warning, use --no-warn-script-location.
Successfully installed pip-20.0.2 setuptools-46.1.3 wheel-0.34.2

你可能感兴趣的:(pip安装报错ModuleNotFoundError: No module named 'distutils.util')