AUTOMATIC1111 / stable-diffusion-webui

Stable Diffusion web UI
GNU Affero General Public License v3.0
142.94k stars 26.94k forks source link

[Bug]: Issue with Python 3.10.6 and Sharkcodecs launcher64.exe #16657

Open kingkennyb opened 1 day ago

kingkennyb commented 1 day ago

Checklist

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 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

  1. Run SharkCodecs install process and launcher64.exe. Close the Codec window.
  2. 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 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 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 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 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 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 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 from gradio import ( File "C:\Users\Admin\Downloads\AI\stable-diffusion-webui\venv\lib\site-packages\gradio\networking.py", line 18, in from gradio.routes import App File "C:\Users\Admin\Downloads\AI\stable-diffusion-webui\venv\lib\site-packages\gradio\routes.py", line 60, in 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

Console logs

N/A

Additional information

N/A

kingkennyb commented 1 day ago

Found some updates from people that had used Python 3.10.11. Also tried updating PIP: C:\Users\Admin>python --version Python 3.10.11

C:\Users\Admin>pip list Package Version


pip 23.0.1 setuptools 65.5.0

[notice] A new release of pip is available: 23.0.1 -> 24.3.1 [notice] To update, run: python.exe -m pip install --upgrade pip

C:\Users\Admin>python.exe -m pip install --upgrade pip

Requirement already satisfied: pip in c:\users\admin\appdata\local\programs\python\python310\lib\site-packages (23.0.1)

Collecting pip Using cached pip-24.3.1-py3-none-any.whl (1.8 MB) Installing collected packages: pip Attempting uninstall: pip Found existing installation: pip 23.0.1 Uninstalling pip-23.0.1: Successfully uninstalled pip-23.0.1 Successfully installed pip-24.3.1 C:\Users\Admin>

SD Works. I can get the http page - but as soon as I run the SharkCodecs launcher64,exe - SD stops working again.

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: Traceback (most recent call last): File "C:\AI\webui\launch.py", line 48, in main() File "C:\AI\webui\launch.py", line 44, in main start() File "C:\AI\webui\modules\launch_utils.py", line 465, in start import webui File "C:\AI\webui\webui.py", line 13, in initialize.imports() File "C:\AI\webui\modules\initialize.py", line 23, in imports import gradio # noqa: F401 File "C:\AI\system\python\lib\site-packages\gradio__init.py", line 3, in import gradio.components as components File "C:\AI\system\python\lib\site-packages\gradio\components\init__.py", line 1, in from gradio.components.annotated_image import AnnotatedImage File "C:\AI\system\python\lib\site-packages\gradio\components\annotated_image.py", line 13, in from gradio.components.base import IOComponent, _Keywords File "C:\AI\system\python\lib\site-packages\gradio\components\base.py", line 29, in from gradio.blocks import Block, BlockContext File "C:\AI\system\python\lib\site-packages\gradio\blocks.py", line 28, in from gradio import ( File "C:\AI\system\python\lib\site-packages\gradio\networking.py", line 18, in from gradio.routes import App File "C:\AI\system\python\lib\site-packages\gradio\routes.py", line 60, in mimetypes.init() File "mimetypes.py", line 368, in init File "mimetypes.py", line 253, in read_windows_registry PermissionError: [WinError 5] Access is denied Press any key to continue . . .