krita-ai-diffusion icon indicating copy to clipboard operation
krita-ai-diffusion copied to clipboard

install failed

Open smallma opened this issue 2 years ago • 1 comments

After I installed AI image Generation from Krita, I clicked on configuration to install the required packages for the latest version, but the following error occurred, please help solve it, thank you.

Error Message: Can't not find the version satisfies the requirement torch, ERROR no matching distribution found for torch

Mac M2, macOS 12.4

Log client.log server.log

image

smallma avatar Dec 17 '23 14:12 smallma

me too, same error, mac m2, macOS 12.7, selected Use MPS (Metal Performance Shader), CPU will be way too slow. looks like pyTorch couldnt find a compatible version? not sure

2024-04-17 22:32:21,253 ERROR Error during installation: ERROR: Could not find a version that satisfies the requirement torch (from versions: none) ERROR: No matching distribution found for torch Traceback (most recent call last): File "/Users/ben/Library/Application Support/krita/pykrita/ai_diffusion/server.py", line 264, in install await self._install(cb) File "/Users/ben/Library/Application Support/krita/pykrita/ai_diffusion/server.py", line 139, in _install await try_install(comfy_dir, self._install_comfy, comfy_dir, network, cb) File "/Users/ben/Library/Application Support/krita/pykrita/ai_diffusion/server.py", line 559, in try_install raise e File "/Users/ben/Library/Application Support/krita/pykrita/ai_diffusion/server.py", line 554, in try_install await installer(*args) File "/Users/ben/Library/Application Support/krita/pykrita/ai_diffusion/server.py", line 193, in _install_comfy await _execute_process("PyTorch", self._pip_install(*torch_args), self.path, cb) File "/Users/ben/Library/Application Support/krita/pykrita/ai_diffusion/server.py", line 548, in _execute_process raise Exception(f"Error during installation: {errlog}") Exception: Error during installation: ERROR: Could not find a version that satisfies the requirement torch (from versions: none) ERROR: No matching distribution found for torch

benbun avatar Apr 17 '24 15:04 benbun

me too, same error, mac m2, macOS 12.7, selected Use MPS (Metal Performance Shader) ERROR Error during installation: ERROR: Could not find a version that satisfies the requirement torch (from versions: none) ERROR: No matching distribution found for torch

izcohatl avatar Jul 17 '24 23:07 izcohatl

anybody?

jotablindfold avatar Aug 21 '24 09:08 jotablindfold

It's likely python version is too old. You can find which one is found in the logs.

Also possible you need macOS 14 (I don't have a mac to test this)

Acly avatar Aug 22 '24 07:08 Acly

Extract the latest plugin zip file, go to ai_diffusion/server.py. and edit these lines(Showing for my version of plugin):

torch_args = ["torch~=2.6.0", "torchvision~=0.21.0", "torchaudio~=2.6.0"] if self.backend is ServerBackend.cpu: torch_args += ["--index-url", "https://download.pytorch.org/whl/cpu"] elif self.backend is ServerBackend.cuda: torch_args += ["--index-url", "https://download.pytorch.org/whl/cu124"] elif self.backend is ServerBackend.directml: torch_args = ["numpy<2", "torch-directml"] await _execute_process("PyTorch", self._pip_install(*torch_args), self.path, cb)

to:

torch_args = ["torch", "torchvision", "torchaudio"] if self.backend is ServerBackend.cpu: torch_args += ["--index-url", "https://download.pytorch.org/whl/nightly/cpu"] elif self.backend is ServerBackend.cuda: torch_args += ["--index-url", "https://download.pytorch.org/whl/nightly/cu124"] elif self.backend is ServerBackend.directml: torch_args = ["numpy<2", "torch-directml"] await _execute_process("PyTorch", self._pip_install(*torch_args), self.path, cb)

Now install as normal way and it would work.

hemant571990 avatar Apr 10 '25 03:04 hemant571990

Sometimes, you need to go to location and update the pip in the environment (activate env).

hemant571990 avatar Apr 10 '25 03:04 hemant571990