$ python3.7 get-pip.py Traceback (most recent call last): File "get-pip.py", line 32321, in <module> main() File "get-pip.py", line 135, in main bootstrap(tmpdir=tmpdir) File "get-pip.py", line 111, in bootstrap monkeypatch_for_cert(tmpdir) File "get-pip.py", line 92, in monkeypatch_for_cert from pip._internal.commands.install import InstallCommand File "/tmp/tmpk9odbp_y/pip.zip/pip/_internal/commands/__init__.py", line 9, in <module> File "/tmp/tmpk9odbp_y/pip.zip/pip/_internal/cli/base_command.py", line 15, in <module> File "/tmp/tmpk9odbp_y/pip.zip/pip/_internal/cli/cmdoptions.py", line 24, in <module> File "/tmp/tmpk9odbp_y/pip.zip/pip/_internal/cli/parser.py", line 12, in <module> File "/tmp/tmpk9odbp_y/pip.zip/pip/_internal/configuration.py", line 26, in <module> File "/tmp/tmpk9odbp_y/pip.zip/pip/_internal/utils/logging.py", line 29, in <module> File "/tmp/tmpk9odbp_y/pip.zip/pip/_internal/utils/misc.py", line 44, in <module> File "/tmp/tmpk9odbp_y/pip.zip/pip/_internal/locations/__init__.py", line 66, in <module> File "/tmp/tmpk9odbp_y/pip.zip/pip/_internal/locations/_distutils.py", line 20, in <module> ModuleNotFoundError: No module named 'distutils.cmd'
从错误信息 ModuleNotFoundError: No module named ‘distutils.cmd’ 看是缺少 distutils 模块,便使用 apt-get 命令来安装该模块:
1 2 3 4 5 6 7
$ apt-get install python3-distutils Reading package lists... Done Building dependency tree Reading state information... Done python3-distutils is already the newest version (3.8.10-0ubuntu1~20.04). python3-distutils set to manually installed. 0 upgraded, 0 newly installed, 0 to remove and 2 not upgraded.