当我想要升级 pip 时出现错误,如何解决?

I get error when i want upgrade pip, how can fix it?

我需要升级pip 但是当我想使用 python -m pip install --upgrade pip 时,出现错误:

例外是:

ERROR: Exception:
Traceback (most recent call last):
  File "D:\python\lib\site-packages\pip-21.2.2-py3.7.egg\pip\_internal\cli\base_command.py", line 173, in _main
    status = self.run(options, args)
  File "D:\python\lib\site-packages\pip-21.2.2-py3.7.egg\pip\_internal\cli\req_command.py", line 203, in wrapper
    return func(self, options, args)
  File "D:\python\lib\site-packages\pip-21.2.2-py3.7.egg\pip\_internal\commands\install.py", line 399, in run
    pycompile=options.compile,
  File "D:\python\lib\site-packages\pip-21.2.2-py3.7.egg\pip\_internal\req\__init__.py", line 81, in install_given_reqs
    pycompile=pycompile,
  File "D:\python\lib\site-packages\pip-21.2.2-py3.7.egg\pip\_internal\req\req_install.py", line 766, in install
    requested=self.user_supplied,
  File "D:\python\lib\site-packages\pip-21.2.2-py3.7.egg\pip\_internal\operations\install\wheel.py", line 802, in install_wheel
    requested=requested,
  File "D:\python\lib\site-packages\pip-21.2.2-py3.7.egg\pip\_internal\operations\install\wheel.py", line 704, in _install_wheel
    generated_console_scripts = maker.make_multiple(scripts_to_generate)
  File "D:\python\lib\site-packages\pip-21.2.2-py3.7.egg\pip\_vendor\distlib\scripts.py", line 422, in make_multiple
    filenames.extend(self.make(specification, options))
  File "D:\python\lib\site-packages\pip-21.2.2-py3.7.egg\pip\_internal\operations\install\wheel.py", line 448, in make
    return super().make(specification, options)
  File "D:\python\lib\site-packages\pip-21.2.2-py3.7.egg\pip\_vendor\distlib\scripts.py", line 411, in make
    self._make_script(entry, filenames, options=options)
  File "D:\python\lib\site-packages\pip-21.2.2-py3.7.egg\pip\_vendor\distlib\scripts.py", line 312, in _make_script
    self._write_script(scriptnames, shebang, script, filenames, ext)
  File "D:\python\lib\site-packages\pip-21.2.2-py3.7.egg\pip\_vendor\distlib\scripts.py", line 242, in _write_script
    launcher = self._get_launcher('t')
  File "D:\python\lib\site-packages\pip-21.2.2-py3.7.egg\pip\_vendor\distlib\scripts.py", line 390, in _get_launcher
    raise ValueError(msg)
ValueError: Unable to find resource t64.exe in package pip._vendor.distlib
WARNING: Ignoring invalid distribution -ip (d:\python\lib\site-packages)
WARNING: Ignoring invalid distribution -ip (d:\python\lib\site-packages)
WARNING: Ignoring invalid distribution -ip (d:\python\lib\site-packages)

最终引发 ValueError(msg)

我应该怎么做才能解决这个错误?

你可以使用这个命令

easy_install --upgrade pip