0

I'm stuck with this error message. I'm not able to update pip or install any package.

Getting the same error message with python -m pip install PACKAGENAME and python -m pip install --upgrade pip

Pip version: C:\Users\Benjamin>python -m pip --version pip 20.2.2 from C:\Python36\lib\site-packages\pip (python 3.6)

Error Message in Terminal:

C:\Users\Benjamin>python -m pip install - upgrade pip
Traceback (most recent call last):
  File "C:\Python36\lib\runpy.py", line 193, in _run_module_as_main
    "__main__", mod_spec)
  File "C:\Python36\lib\runpy.py", line 85, in _run_code
    exec(code, run_globals)
  File "C:\Python36\lib\site-packages\pip\__main__.py", line 26, in <module>
    sys.exit(_main())
  File "C:\Python36\lib\site-packages\pip\_internal\cli\main.py", line 73, in main
    command = create_command(cmd_name, isolated=("--isolated" in cmd_args))
  File "C:\Python36\lib\site-packages\pip\_internal\commands\__init__.py", line 104, in create_command
    module = importlib.import_module(module_path)
  File "C:\Python36\lib\importlib\__init__.py", line 126, in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
  File "<frozen importlib._bootstrap>", line 994, in _gcd_import
  File "<frozen importlib._bootstrap>", line 971, in _find_and_load
  File "<frozen importlib._bootstrap>", line 955, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 665, in _load_unlocked
  File "<frozen importlib._bootstrap_external>", line 678, in exec_module
  File "<frozen importlib._bootstrap>", line 219, in _call_with_frames_removed
  File "C:\Python36\lib\site-packages\pip\_internal\commands\install.py", line 17, in <module>
    from pip._internal.cli.req_command import RequirementCommand, with_cleanup
  File "C:\Python36\lib\site-packages\pip\_internal\cli\req_command.py", line 16, in <module>
    from pip._internal.index.collector import LinkCollector
  File "C:\Python36\lib\site-packages\pip\_internal\index\collector.py", line 14, in <module>
    from pip._vendor import html5lib, requests
  File "C:\Python36\lib\site-packages\pip\_vendor\html5lib\__init__.py", line 25, in <module>
    from .html5parser import HTMLParser, parse, parseFragment
  File "C:\Python36\lib\site-packages\pip\_vendor\html5lib\html5parser.py", line 6, in <module>
    from . import _inputstream
  File "C:\Python36\lib\site-packages\pip\_vendor\html5lib\_inputstream.py", line 10, in <module>
    from pip._vendor import webencodings
ImportError: cannot import name 'webencodings'
BenjaminK
  • 653
  • 1
  • 9
  • 26
  • Try `python -m ensurepip --upgrade` . If it doesn't help do a reinstall using [`get-pip.py`](https://stackoverflow.com/a/65871131/7976758). – phd Jul 21 '22 at 13:18
  • I now tried using your command `python -m ensurepip --upgrade` and it went through without errors. Now I've tried to install a package again and it's now saying `ImportError: cannot import name 'PackageFinder'` – BenjaminK Jul 21 '22 at 21:55

0 Answers0