Repository: stable-diffusion-webui
Issue: [Bug]: Issue with Python 3.10.6 and Sharkcodecs launcher64.exe
Labels: bug-report

### Checklist

- [ ] The issue exists after disabling all extensions
- [X] The issue exists on a clean installation of webui
- [ ] The issue is caused by an extension, but I believe it is caused by a bug in the webui
- [ ] The issue exists in the current version of the webui
- [ ] The issue has not been reported before recently
- [ ] The issue has been reported before but has not been fixed yet

### What happened?

It's took me about 2 weeks to work out what was causing the issue and I have now been able to isolate it to SharkCodecs launcher64.exe.  This is a handy all in one codec pack. I have been used it for many years:

https://shark007.net/x64components1.html


When I first tried to install SD it was failing to run Python. Loads of errors. Couldnt see PIP. Couldnt install PIP. 

Downloading charset_normalizer-3.4.0-cp310-cp310-win_amd64.whl (102 kB)
Downloading idna-3.10-py3-none-any.whl (70 kB)
Downloading MarkupSafe-3.0.2-cp310-cp310-win_amd64.whl (15 kB)
Downloading urllib3-2.2.3-py3-none-any.whl (126 kB)
ERROR: Could not install packages due to an OSError: [WinError 5] Access is denied
Consider using the `--user` option or check the permissions.

C:\Users\Admin>python --version
Python 3.10.6

C:\Users\Admin>python -m ensurepip --default-pip
Looking in links: c:\Users\Admin\AppData\Local\Temp\tmpecnskf41
ERROR: Could not install packages due to an OSError: [WinError 5] Access is denied
Consider using the `--user` option or check the permissions.

Traceback (most recent call last):
  File "C:\Users\Admin\AppData\Local\Programs\Python\Python310\lib\runpy.py", line 196, in _run_module_as_main
    return _run_code(code, main_globals, None,
  File "C:\Users\Admin\AppData\Local\Programs\Python\Python310\lib\runpy.py", line 86, in _run_code
    exec(code, run_globals)
  File "C:\Users\Admin\AppData\Local\Programs\Python\Python310\lib\ensurepip\__main__.py", line 5, in <module>
    sys.exit(ensurepip._main())
  File "C:\Users\Admin\AppData\Local\Programs\Python\Python310\lib\ensurepip\__init__.py", line 287, in _main
    return _bootstrap(
  File "C:\Users\Admin\AppData\Local\Programs\Python\Python310\lib\ensurepip\__init__.py", line 203, in _bootstrap
    return _run_pip([*args, *_PACKAGE_NAMES], additional_paths)
  File "C:\Users\Admin\AppData\Local\Programs\Python\Python310\lib\ensurepip\__init__.py", line 104, in _run_pip
    return subprocess.run(cmd, check=True).returncode
  File "C:\Users\Admin\AppData\Local\Programs\Python\Python310\lib\subprocess.py", line 524, in run
    raise CalledProcessError(retcode, process.args,
subprocess.CalledProcessError: Command '['C:\\Users\\Admin\\AppData\\Local\\Programs\\Python\\Python310\\python.exe', '-W', 'ignore::DeprecationWarning', '-c', '\nimport runpy\nimport sys\nsys.path = [\'C:\\\\Users\\\\Admin\\\\AppData\\\\Local\\\\Temp\\\\tmpecnskf41\\\\setuptools-63.2.0-py3-none-any.whl\', \'C:\\\\Users\\\\Admin\\\\AppData\\\\Local\\\\Temp\\\\tmpecnskf41\\\\pip-22.2.1-py3-none-any.whl\'] + sys.path\nsys.argv[1:] = [\'install\', \'--no-cache-dir\', \'--no-index\', \'--find-links\', \'C:\\\\Users\\\\Admin\\\\AppData\\\\Local\\\\Temp\\\\tmpecnskf41\', \'setuptools\', \'pip\']\nrunpy.run_module("pip", run_name="__main__", alter_sys=True)\n']' returned non-zero exit status 1.

Anywayyyzzzzzz. 

New Windows install and decided to install SD first. It works... :) No issues - but as soon as I run the Codecs pack Launcher.exe it seems to mess up Python or permissions or something. I cant see what its doing. I have contacted Shark Codecs owner for help incase its doing something but its only adding codecs for MPC-BE player.

If you happen to have SharkCodecs installed first by running the launcher64.exe at any point - SD will fail to install and Python will chuck up errors. Although Git and Python install fine.

All windows PATHS look OK. All envs look OK. Permissions look OK. 

%USERPROFILE%\AppData\Local\Microsoft\WindowsApps;
C:\Users\Admin\AppData\Local\Programs\Python\Python310\
C:\Users\Admin\AppData\Local\Programs\Python\Python310\Scripts\

C:\Users\Admin>pip list
Package    Version
---------- -------
pip        22.2.1
setuptools 63.2.0

[notice] A new release of pip available: 22.2.1 -> 24.3.1
[notice] To update, run: python.exe -m pip install --upgrade pip

C:\Users\Admin>pip --version
pip 22.2.1 from C:\Users\Admin\AppData\Local\Programs\Python\Python310\lib\site-packages\pip (python 3.10)

C:\Users\Admin>python --version
Python 3.10.6

I cant see what its doing but suspect a bug in Python 3.10.6 maybe?  but the install process says 3.10.6 is needed.


### Steps to reproduce the problem

1. Windows 10 and 11 vmware clean build. 
2. Install GIT and Python 3.10.6. Added set COMMANDLINE_ARGS= --skip-torch-cuda-test (Not expecting it to work as no pysical GPU but can still see the code and URL http page opens...)

venv "C:\Users\Admin\Downloads\AI\stable-diffusion-webui\venv\Scripts\Python.exe"
Python 3.10.6 (tags/v3.10.6:9c7b4bd, Aug  1 2022, 21:53:49) [MSC v.1932 64 bit (AMD64)]
Version: v1.10.1
Commit hash: 82a973c04367123ae98bd9abdf80d9eda9b910e2
Launching Web UI with arguments: --skip-torch-cuda-test
C:\Users\Admin\Downloads\AI\stable-diffusion-webui\venv\lib\site-packages\timm\models\layers\__init__.py:48: FutureWarning: Importing from timm.models.layers is deprecated, please import via timm.layers
  warnings.warn(f"Importing from {__name__} is deprecated, please import via timm.layers", FutureWarning)
no module 'xformers'. Processing without...
no module 'xformers'. Processing without...
No module 'xformers'. Proceeding without it.

Warning: caught exception 'Found no NVIDIA driver on your system. Please check that you have an NVIDIA GPU and installed a driver from http://www.nvidia.com/Download/index.aspx', memory monitor disabled
Loading weights [cc6cb27103] from C:\Users\Admin\Downloads\AI\stable-diffusion-webui\models\Stable-diffusion\v1-5-pruned-emaonly.ckpt
Running on local URL:  http://127.0.0.1:7860

To create a public link, set `share=True` in `launch()`.
Startup time: 4.4s (prepare environment: 0.2s, import torch: 1.9s, import gradio: 0.5s, setup paths: 0.5s, initialize shared: 0.3s, other imports: 0.2s, load scripts: 0.5s, create ui: 0.3s, gradio launch: 0.1s).
Creating model from config: C:\Users\Admin\Downloads\AI\stable-diffusion-webui\configs\v1-inference.yaml
C:\Users\Admin\Downloads\AI\stable-diffusion-webui\venv\lib\site-packages\huggingface_hub\file_download.py:797: FutureWarning: `resume_download` is deprecated and will be removed in version 1.0.0. Downloads always resume when possible. If you want to force a new download, use `force_download=True`.
  warnings.warn(
Applying attention optimization: InvokeAI... done.
loading stable diffusion model: RuntimeError
Traceback (most recent call last):
  File "C:\Users\Admin\AppData\Local\Programs\Python\Python310\lib\threading.py", line 973, in _bootstrap
    self._bootstrap_inner()
  File "C:\Users\Admin\AppData\Local\Programs\Python\Python310\lib\threading.py", line 1016, in _bootstrap_inner
    self.run()
  File "C:\Users\Admin\AppData\Local\Programs\Python\Python310\lib\threading.py", line 953, in run
    self._target(*self._args, **self._kwargs)
  File "C:\Users\Admin\Downloads\AI\stable-diffusion-webui\modules\initialize.py", line 149, in load_model
    shared.sd_model  # noqa: B018
  File "C:\Users\Admin\Downloads\AI\stable-diffusion-webui\modules\shared_items.py", line 175, in sd_model
    return modules.sd_models.model_data.get_sd_model()
  File "C:\Users\Admin\Downloads\AI\stable-diffusion-webui\modules\sd_models.py", line 693, in get_sd_model
    load_model()
  File "C:\Users\Admin\Downloads\AI\stable-diffusion-webui\modules\sd_models.py", line 868, in load_model
    with devices.autocast(), torch.no_grad():
  File "C:\Users\Admin\Downloads\AI\stable-diffusion-webui\modules\devices.py", line 228, in autocast
    if has_xpu() or has_mps() or cuda_no_autocast():
  File "C:\Users\Admin\Downloads\AI\stable-diffusion-webui\modules\devices.py", line 28, in cuda_no_autocast
    device_id = get_cuda_device_id()
  File "C:\Users\Admin\Downloads\AI\stable-diffusion-webui\modules\devices.py", line 40, in get_cuda_device_id
    ) or torch.cuda.current_device()
  File "C:\Users\Admin\Downloads\AI\stable-diffusion-webui\venv\lib\site-packages\torch\cuda\__init__.py", line 769, in current_device
    _lazy_init()
  File "C:\Users\Admin\Downloads\AI\stable-diffusion-webui\venv\lib\site-packages\torch\cuda\__init__.py", line 298, in _lazy_init
    torch._C._cuda_init()

RuntimeError: Found no NVIDIA driver on your system. Please check that you have an NVIDIA GPU and installed a driver from http://www.nvidia.com/Download/index.aspx



3. Run SharkCodecs install process and launcher64.exe.  Close the Codec window. 
4. Retry SD and it errors....

venv "C:\Users\Admin\Downloads\AI\stable-diffusion-webui\venv\Scripts\Python.exe"
Python 3.10.6 (tags/v3.10.6:9c7b4bd, Aug  1 2022, 21:53:49) [MSC v.1932 64 bit (AMD64)]
Version: v1.10.1
Commit hash: 82a973c04367123ae98bd9abdf80d9eda9b910e2
Launching Web UI with arguments: --skip-torch-cuda-test
Traceback (most recent call last):
  File "C:\Users\Admin\Downloads\AI\stable-diffusion-webui\launch.py", line 48, in <module>
    main()
  File "C:\Users\Admin\Downloads\AI\stable-diffusion-webui\launch.py", line 44, in main
    start()
  File "C:\Users\Admin\Downloads\AI\stable-diffusion-webui\modules\launch_utils.py", line 465, in start
    import webui
  File "C:\Users\Admin\Downloads\AI\stable-diffusion-webui\webui.py", line 13, in <module>
    initialize.imports()
  File "C:\Users\Admin\Downloads\AI\stable-diffusion-webui\modules\initialize.py", line 23, in imports
    import gradio  # noqa: F401
  File "C:\Users\Admin\Downloads\AI\stable-diffusion-webui\venv\lib\site-packages\gradio\__init__.py", line 3, in <module>
    import gradio.components as components
  File "C:\Users\Admin\Downloads\AI\stable-diffusion-webui\venv\lib\site-packages\gradio\components\__init__.py", line 1, in <module>
    from gradio.components.annotated_image import AnnotatedImage
  File "C:\Users\Admin\Downloads\AI\stable-diffusion-webui\venv\lib\site-packages\gradio\components\annotated_image.py", line 13, in <module>
    from gradio.components.base import IOComponent, _Keywords
  File "C:\Users\Admin\Downloads\AI\stable-diffusion-webui\venv\lib\site-packages\gradio\components\base.py", line 29, in <module>
    from gradio.blocks import Block, BlockContext
  File "C:\Users\Admin\Downloads\AI\stable-diffusion-webui\venv\lib\site-packages\gradio\blocks.py", line 28, in <module>
    from gradio import (
  File "C:\Users\Admin\Downloads\AI\stable-diffusion-webui\venv\lib\site-packages\gradio\networking.py", line 18, in <module>
    from gradio.routes import App
  File "C:\Users\Admin\Downloads\AI\stable-diffusion-webui\venv\lib\site-packages\gradio\routes.py", line 60, in <module>
    mimetypes.init()
  File "C:\Users\Admin\AppData\Local\Programs\Python\Python310\lib\mimetypes.py", line 368, in init
    db.read_windows_registry()
  File "C:\Users\Admin\AppData\Local\Programs\Python\Python310\lib\mimetypes.py", line 253, in read_windows_registry
    _mimetypes_read_windows_registry(add_type)
PermissionError: [WinError 5] Access is denied
Press any key to continue . . .

I have created a VMware snapshot which I keep rolling back to for testing. If anybody has any ideas? That would be great. 













### What should have happened?

SD should run as expected and produce the GUI http page.

### What browsers do you use to access the UI ?

Google Chrome

### Sysinfo

[sysinfo-2024-11-15-17-12.json](https://github.com/user-attachments/files/17778831/sysinfo-2024-11-15-17-12.json)


### Console logs

```Shell
N/A
```


### Additional information

N/A