install failed
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
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
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
anybody?
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)
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.
Sometimes, you need to go to location and update the pip in the environment (activate env).