title: python pip corrupted, can't repair or uninstall
body: <p>Due to a series of events described later I am getting the following error in the command prompt whenever I try to do anything with pip.</p>
  
  <pre><code>(venv) (base) C:\Users\Mark Kortink\Dropbox\Python\projects\metapplica&gt;pip install flask
  Traceback (most recent call last):
    File "C:\ProgramData\Anaconda3\lib\runpy.py", line 193, in _run_module_as_main
      "__main__", mod_spec)
    File "C:\ProgramData\Anaconda3\lib\runpy.py", line 85, in _run_code
      exec(code, run_globals)
    File "C:\Users\MARKKO~1\Dropbox\Python\projects\METAPP~1\venv\Scripts\pip.exe\__main__.py", line 9, in &lt;module&gt;
    File "c:\users\markko~1\dropbox\python\projects\metapp~1\venv\lib\site-packages\pip\_internal\main.py", line 45, in main
      command = create_command(cmd_name, isolated=("--isolated" in cmd_args))
    File "c:\users\markko~1\dropbox\python\projects\metapp~1\venv\lib\site-packages\pip\_internal\commands\__init__.py", line 96, in create_command
      module = importlib.import_module(module_path)
    File "C:\ProgramData\Anaconda3\lib\importlib\__init__.py", line 127, in import_module
      return _bootstrap._gcd_import(name[level:], package, level)
    File "&lt;frozen importlib._bootstrap&gt;", line 1006, in _gcd_import
    File "&lt;frozen importlib._bootstrap&gt;", line 983, in _find_and_load
    File "&lt;frozen importlib._bootstrap&gt;", line 967, in _find_and_load_unlocked
    File "&lt;frozen importlib._bootstrap&gt;", line 677, in _load_unlocked
    File "&lt;frozen importlib._bootstrap_external&gt;", line 728, in exec_module
    File "&lt;frozen importlib._bootstrap&gt;", line 219, in _call_with_frames_removed
    File "c:\users\markko~1\dropbox\python\projects\metapp~1\venv\lib\site-packages\pip\_internal\commands\install.py", line 23, in &lt;module&gt;
      from pip._internal.cli.req_command import RequirementCommand
    File "c:\users\markko~1\dropbox\python\projects\metapp~1\venv\lib\site-packages\pip\_internal\cli\req_command.py", line 17, in &lt;module&gt;
      from pip._internal.index import PackageFinder
  ImportError: cannot import name 'PackageFinder' from 'pip._internal.index' (c:\users\markko~1\dropbox\python\projects\metapp~1\venv\lib\site-packages\pip\_internal\index\__init__.py)
  </code></pre>
  
  <p>All the circumstances are described in my other question which didn't get a useful answer. It is here <a href="https://stackoverflow.com/questions/60478929/debuggers-throwing-modulenotfounderror-no-module-named-werkzeug-wrappers-json/60482685?noredirect=1#comment107006800_60482685">ModuleNotFoundError</a>. </p>
  
  <p>I a nutshell: -</p>
  
  <ol>
  <li>I had an working app in Flask running in an Anaconda environment
  with everything installed using pip (not conda), it used
  flask-bootstrap.</li>
  <li>I uninstalled flask-bootstrap and installed a different package
      Bootsrap-flask to get bootstrap-4, it worked.</li>
  <li>I uninstalled Bootstrap-flask because I decided to go pure CSS.   </li>
  <li>I can still run my app from the Anaconda environment in its venv
      using "flask run".</li>
  <li>But as soon as I try and run anything flask related in a debugger
      (Spyder or VSCode) i get that core Flask libraries cannot be found.</li>
  <li>And as soon as I do anything with pip I get the above error.</li>
  </ol>
  
  <p>I believe all the detail above is a distraction, I have incuded it for completeness and it is covered in my other linked question. I believe the root cause should be apparent from the above read-out from the command prompt. In particular <code>ImportError: cannot import name 'PackageFinder' from 'pip._internal.index'</code></p>
  
  <p>Can anyone suggest anything. If not how do I safely and cleanly remove my Flask venv environment and reinstall it without losing anything.</p>
  
  <p>Thanks</p>