Traceback (most recent call last):
File "/home/py_virtual_env/q16/bin/pip3", line 5, in <module>
from pip._internal.cli.main import main
File "/home/py_virtual_env/q16/lib/python3.9/site-packages/pip/_internal/cli/main.py", line 9, in <module>
from pip._internal.cli.autocompletion import autocomplete
File "/home/py_virtual_env/q16/lib/python3.9/site-packages/pip/_internal/cli/autocompletion.py", line 10, in <module>
from pip._internal.cli.main_parser import create_main_parser
File "/home/py_virtual_env/q16/lib/python3.9/site-packages/pip/_internal/cli/main_parser.py", line 8, in <module>
from pip._internal.cli import cmdoptions
File "/home/py_virtual_env/q16/lib/python3.9/site-packages/pip/_internal/cli/cmdoptions.py", line 24, in <module>
from pip._internal.cli.parser import ConfigOptionParser
File "/home/py_virtual_env/q16/lib/python3.9/site-packages/pip/_internal/cli/parser.py", line 12, in <module>
from pip._internal.configuration import Configuration, ConfigurationError
File "/home/py_virtual_env/q16/lib/python3.9/site-packages/pip/_internal/configuration.py", line 26, in <module>
from pip._internal.utils.logging import getLogger
File "/home/py_virtual_env/q16/lib/python3.9/site-packages/pip/_internal/utils/logging.py", line 29, in <module>
from pip._internal.utils.misc import ensure_dir
File "/home/py_virtual_env/q16/lib/python3.9/site-packages/pip/_internal/utils/misc.py", line 42, in <module>
from pip._internal.locations import get_major_minor_version
File "/home/py_virtual_env/q16/lib/python3.9/site-packages/pip/_internal/locations/__init__.py", line 67, in <module>
from . import _distutils
File "/home/py_virtual_env/q16/lib/python3.9/site-packages/pip/_internal/locations/_distutils.py", line 20, in <module>
from distutils.cmd import Command as DistutilsCommand
ModuleNotFoundError: No module named 'distutils.cmd'
解决办法:
sudo apt-get install python3.9-distutils 3.9 是对应版本
标签:named,cmd,distutils,py,virtual,internal,pip,import,python3.9 From: https://www.cnblogs.com/simpleyue/p/16767814.html