Fix ModuleNotFoundError: No module named ‘distutils.cmd’

2,140次阅读
root@debi:~# wget https://bootstrap.pypa.io/get-pip.py
root@debi:~# python3 get-pip.py
Traceback (most recent call last):
  File "/root/get-pip.py", line 24556, in <module>
    main()
  File "/root/get-pip.py", line 139, in main
    bootstrap(tmpdir=tmpdir)
  File "/root/get-pip.py", line 115, in bootstrap
    monkeypatch_for_cert(tmpdir)
  File "/root/get-pip.py", line 96, in monkeypatch_for_cert
    from pip._internal.commands.install import InstallCommand
  File "<frozen zipimport>", line 259, in load_module
  File "/tmp/tmpc1mpf262/pip.zip/pip/_internal/commands/__init__.py", line 9, in <module>
  File "<frozen zipimport>", line 259, in load_module
  File "/tmp/tmpc1mpf262/pip.zip/pip/_internal/cli/base_command.py", line 12, in <module>
  File "<frozen zipimport>", line 259, in load_module
  File "/tmp/tmpc1mpf262/pip.zip/pip/_internal/cli/cmdoptions.py", line 23, in <module>
  File "<frozen zipimport>", line 259, in load_module
  File "/tmp/tmpc1mpf262/pip.zip/pip/_internal/cli/parser.py", line 12, in <module>
  File "<frozen zipimport>", line 259, in load_module
  File "/tmp/tmpc1mpf262/pip.zip/pip/_internal/configuration.py", line 27, in <module>
  File "<frozen zipimport>", line 259, in load_module
  File "/tmp/tmpc1mpf262/pip.zip/pip/_internal/utils/misc.py", line 42, in <module>
  File "<frozen zipimport>", line 259, in load_module
  File "/tmp/tmpc1mpf262/pip.zip/pip/_internal/locations/__init__.py", line 14, in <module>
  File "<frozen zipimport>", line 259, in load_module
  File "/tmp/tmpc1mpf262/pip.zip/pip/_internal/locations/_distutils.py", line 9, in <module>
ModuleNotFoundError: No module named 'distutils.cmd'

The module not found likely means the packages aren’t installed.

sudo apt-get install python3-distutils
正文完