Yeah, I have been removing any remnant Python directories each time I uninstall. The result with --verbose is long and generally shows the same error.
C:\Users\name>py -3.11 -m ensurepip --default-pip --upgrade --verbose
Using pip 24.0 from C:\Users\name\AppData\Local\Temp\tmpelwhd4vu\pip-24.0-py3-none-any.whl\pip (python 3.11)
Looking in links: c:\Users\name\AppData\Local\Temp\tmpelwhd4vu
ERROR: Could not install packages due to an OSError.
Consider using the `--user` option or check the permissions.
Traceback (most recent call last):
File "C:\Users\name\AppData\Local\Temp\tmpelwhd4vu\pip-24.0-py3-none-any.whl\pip\_internal\commands\install.py", line 377, in run
requirement_set = resolver.resolve(
^^^^^^^^^^^^^^^^^
File "C:\Users\name\AppData\Local\Temp\tmpelwhd4vu\pip-24.0-py3-none-any.whl\pip\_internal\resolution\resolvelib\resolver.py", line 95, in resolve
result = self._result = resolver.resolve(
^^^^^^^^^^^^^^^^^
File "C:\Users\name\AppData\Local\Temp\tmpelwhd4vu\pip-24.0-py3-none-any.whl\pip\_vendor\resolvelib\resolvers.py", line 546, in resolve
state = resolution.resolve(requirements, max_rounds=max_rounds)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\name\AppData\Local\Temp\tmpelwhd4vu\pip-24.0-py3-none-any.whl\pip\_vendor\resolvelib\resolvers.py", line 397, in resolve
self._add_to_criteria(self.state.criteria, r, parent=None)
File "C:\Users\name\AppData\Local\Temp\tmpelwhd4vu\pip-24.0-py3-none-any.whl\pip\_vendor\resolvelib\resolvers.py", line 173, in _add_to_criteria
if not criterion.candidates:
File "C:\Users\name\AppData\Local\Temp\tmpelwhd4vu\pip-24.0-py3-none-any.whl\pip\_vendor\resolvelib\structs.py", line 156, in __bool__
return bool(self._sequence)
^^^^^^^^^^^^^^^^^^^^
File "C:\Users\name\AppData\Local\Temp\tmpelwhd4vu\pip-24.0-py3-none-any.whl\pip\_internal\resolution\resolvelib\found_candidates.py", line 155, in __bool__
return any(self)
^^^^^^^^^
File "C:\Users\name\AppData\Local\Temp\tmpelwhd4vu\pip-24.0-py3-none-any.whl\pip\_internal\resolution\resolvelib\found_candidates.py", line 143, in <genexpr>
return (c for c in iterator if id(c) not in self._incompatible_ids)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\name\AppData\Local\Temp\tmpelwhd4vu\pip-24.0-py3-none-any.whl\pip\_internal\resolution\resolvelib\found_candidates.py", line 44, in _iter_built
for version, func in infos:
File "C:\Users\name\AppData\Local\Temp\tmpelwhd4vu\pip-24.0-py3-none-any.whl\pip\_internal\resolution\resolvelib\factory.py", line 297, in iter_index_candidate_infos
result = self._finder.find_best_candidate(
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\name\AppData\Local\Temp\tmpelwhd4vu\pip-24.0-py3-none-any.whl\pip\_internal\index\package_finder.py", line 890, in find_best_candidate
candidates = self.find_all_candidates(project_name)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\name\AppData\Local\Temp\tmpelwhd4vu\pip-24.0-py3-none-any.whl\pip\_internal\index\package_finder.py", line 831, in find_all_candidates
page_candidates = list(page_candidates_it)
^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\name\AppData\Local\Temp\tmpelwhd4vu\pip-24.0-py3-none-any.whl\pip\_internal\index\sources.py", line 127, in page_candidates
for url in self._path_to_urls.page_candidates:
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\name\AppData\Local\Temp\tmpelwhd4vu\pip-24.0-py3-none-any.whl\pip\_internal\index\sources.py", line 83, in page_candidates
self._scan_directory()
File "C:\Users\name\AppData\Local\Temp\tmpelwhd4vu\pip-24.0-py3-none-any.whl\pip\_internal\index\sources.py", line 63, in _scan_directory
if _is_html_file(url):
^^^^^^^^^^^^^^^^^^
File "C:\Users\name\AppData\Local\Temp\tmpelwhd4vu\pip-24.0-py3-none-any.whl\pip\_internal\index\sources.py", line 45, in _is_html_file
return mimetypes.guess_type(file_url, strict=False)[0] == "text/html"
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\name\AppData\Local\Programs\Python\Python311\Lib\mimetypes.py", line 312, in guess_type
init()
File "C:\Users\name\AppData\Local\Programs\Python\Python311\Lib\mimetypes.py", line 374, in init
db.read_windows_registry()
File "C:\Users\name\AppData\Local\Programs\Python\Python311\Lib\mimetypes.py", line 259, in read_windows_registry
_mimetypes_read_windows_registry(add_type)
PermissionError: [WinError 5] Access is denied
Traceback (most recent call last):
File "<frozen runpy>", line 198, in _run_module_as_main
File "<frozen runpy>", line 88, in _run_code
File "C:\Users\name\AppData\Local\Programs\Python\Python311\Lib\ensurepip\__main__.py", line 5, in <module>
sys.exit(ensurepip._main())
^^^^^^^^^^^^^^^^^
File "C:\Users\name\AppData\Local\Programs\Python\Python311\Lib\ensurepip\__init__.py", line 286, in _main
return _bootstrap(
^^^^^^^^^^^
File "C:\Users\name\AppData\Local\Programs\Python\Python311\Lib\ensurepip\__init__.py", line 202, in _bootstrap
return _run_pip([*args, *_PACKAGE_NAMES], additional_paths)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\name\AppData\Local\Programs\Python\Python311\Lib\ensurepip\__init__.py", line 103, in _run_pip
return subprocess.run(cmd, check=True).returncode
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\name\AppData\Local\Programs\Python\Python311\Lib\subprocess.py", line 571, in run
raise CalledProcessError(retcode, process.args,
subprocess.CalledProcessError: Command '['C:\\Users\\name\\AppData\\Local\\Programs\\Python\\Python311\\python.exe', '-W', 'ignore::DeprecationWarning', '-c', '\nimport runpy\nimport sys\nsys.path = [\'C:\\\\Users\\\\name\\\\AppData\\\\Local\\\\Temp\\\\tmpelwhd4vu\\\\setuptools-65.5.0-py3-none-any.whl\', \'C:\\\\Users\\\\name\\\\AppData\\\\Local\\\\Temp\\\\tmpelwhd4vu\\\\pip-24.0-py3-none-any.whl\'] + sys.path\nsys.argv[1:] = [\'install\', \'--no-cache-dir\', \'--no-index\', \'--find-links\', \'C:\\\\Users\\\\name\\\\AppData\\\\Local\\\\Temp\\\\tmpelwhd4vu\', \'--upgrade\', \'-v\', \'setuptools\', \'pip\']\nrunpy.run_module("pip", run_name="__main__", alter_sys=True)\n']' returned non-zero exit status 1.