LarryJane491 / Lora-Training-in-Comfy

This custom node lets you train LoRA directly in ComfyUI!
390 stars 59 forks source link

error:ModuleNotFoundError: No module named 'torch' #22

Open mantoulalala opened 8 months ago

mantoulalala commented 8 months ago

MacOS M1 I already successfully installed pytorch, but i still got this error:

DEPRECATION: Loading egg at /Library/Frameworks/Python.framework/Versions/3.11/lib/python3.11/site-packages/mpmath-1.3.0-py3.11.egg is deprecated. pip 24.3 will enforce this behaviour change. A possible replacement is to use pip for package installation.. Discussion can be found at https://github.com/pypa/pip/issues/12330 Collecting accelerate==0.23.0 (from -r /Users/labixiaoshou/AI/ComfyUI/custom_nodes/Lora-Training-in-Comfy-main/requirements.txt (line 1)) Using cached accelerate-0.23.0-py3-none-any.whl.metadata (18 kB) Collecting transformers==4.30.2 (from -r /Users/labixiaoshou/AI/ComfyUI/custom_nodes/Lora-Training-in-Comfy-main/requirements.txt (line 2)) Using cached transformers-4.30.2-py3-none-any.whl.metadata (113 kB) Requirement already satisfied: ftfy in /Library/Frameworks/Python.framework/Versions/3.11/lib/python3.11/site-packages (from -r /Users/labixiaoshou/AI/ComfyUI/custom_nodes/Lora-Training-in-Comfy-main/requirements.txt (line 4)) (6.1.3) Collecting opencv-python (from -r /Users/labixiaoshou/AI/ComfyUI/custom_nodes/Lora-Training-in-Comfy-main/requirements.txt (line 5)) Using cached opencv_python-4.9.0.80-cp37-abi3-macosx_11_0_arm64.whl.metadata (20 kB) Requirement already satisfied: einops in /Library/Frameworks/Python.framework/Versions/3.11/lib/python3.11/site-packages (from -r /Users/labixiaoshou/AI/ComfyUI/custom_nodes/Lora-Training-in-Comfy-main/requirements.txt (line 6)) (0.7.0) Collecting pytorch-lightning (from -r /Users/labixiaoshou/AI/ComfyUI/custom_nodes/Lora-Training-in-Comfy-main/requirements.txt (line 7)) Using cached pytorch_lightning-2.2.1-py3-none-any.whl.metadata (21 kB) Collecting tensorboard (from -r /Users/labixiaoshou/AI/ComfyUI/custom_nodes/Lora-Training-in-Comfy-main/requirements.txt (line 8)) Using cached tensorboard-2.16.2-py3-none-any.whl.metadata (1.6 kB) Requirement already satisfied: safetensors in /Library/Frameworks/Python.framework/Versions/3.11/lib/python3.11/site-packages (from -r /Users/labixiaoshou/AI/ComfyUI/custom_nodes/Lora-Training-in-Comfy-main/requirements.txt (line 9)) (0.4.2) Collecting altair (from -r /Users/labixiaoshou/AI/ComfyUI/custom_nodes/Lora-Training-in-Comfy-main/requirements.txt (line 10)) Using cached altair-5.2.0-py3-none-any.whl.metadata (8.7 kB) Collecting easygui (from -r /Users/labixiaoshou/AI/ComfyUI/custom_nodes/Lora-Training-in-Comfy-main/requirements.txt (line 11)) Using cached easygui-0.98.3-py2.py3-none-any.whl.metadata (8.4 kB) Collecting toml (from -r /Users/labixiaoshou/AI/ComfyUI/custom_nodes/Lora-Training-in-Comfy-main/requirements.txt (line 12)) Using cached toml-0.10.2-py2.py3-none-any.whl.metadata (7.1 kB) Collecting voluptuous (from -r /Users/labixiaoshou/AI/ComfyUI/custom_nodes/Lora-Training-in-Comfy-main/requirements.txt (line 13)) Using cached voluptuous-0.14.2-py3-none-any.whl.metadata (20 kB) Requirement already satisfied: huggingface-hub in /Library/Frameworks/Python.framework/Versions/3.11/lib/python3.11/site-packages (from -r /Users/labixiaoshou/AI/ComfyUI/custom_nodes/Lora-Training-in-Comfy-main/requirements.txt (line 14)) (0.21.3) Collecting open-clip-torch (from -r /Users/labixiaoshou/AI/ComfyUI/custom_nodes/Lora-Training-in-Comfy-main/requirements.txt (line 15)) Using cached open_clip_torch-2.24.0-py3-none-any.whl.metadata (30 kB) Collecting rich (from -r /Users/labixiaoshou/AI/ComfyUI/custom_nodes/Lora-Training-in-Comfy-main/requirements.txt (line 17)) Using cached rich-13.7.1-py3-none-any.whl.metadata (18 kB) Collecting pandas (from -r /Users/labixiaoshou/AI/ComfyUI/custom_nodes/Lora-Training-in-Comfy-main/requirements.txt (line 18)) Using cached pandas-2.2.1-cp311-cp311-macosx_11_0_arm64.whl.metadata (19 kB) Requirement already satisfied: scipy in /Library/Frameworks/Python.framework/Versions/3.11/lib/python3.11/site-packages (from -r /Users/labixiaoshou/AI/ComfyUI/custom_nodes/Lora-Training-in-Comfy-main/requirements.txt (line 19)) (1.12.0) Requirement already satisfied: requests in /Library/Frameworks/Python.framework/Versions/3.11/lib/python3.11/site-packages (from -r /Users/labixiaoshou/AI/ComfyUI/custom_nodes/Lora-Training-in-Comfy-main/requirements.txt (line 20)) (2.31.0) Requirement already satisfied: pillow in /Library/Frameworks/Python.framework/Versions/3.11/lib/python3.11/site-packages (from -r /Users/labixiaoshou/AI/ComfyUI/custom_nodes/Lora-Training-in-Comfy-main/requirements.txt (line 21)) (9.3.0) Requirement already satisfied: numpy in /Library/Frameworks/Python.framework/Versions/3.11/lib/python3.11/site-packages (from -r /Users/labixiaoshou/AI/ComfyUI/custom_nodes/Lora-Training-in-Comfy-main/requirements.txt (line 22)) (1.26.4) Collecting gradio==3.41.2 (from -r /Users/labixiaoshou/AI/ComfyUI/custom_nodes/Lora-Training-in-Comfy-main/requirements.txt (line 23)) Using cached gradio-3.41.2-py3-none-any.whl.metadata (17 kB) Collecting fastapi (from -r /Users/labixiaoshou/AI/ComfyUI/custom_nodes/Lora-Training-in-Comfy-main/requirements.txt (line 24)) Using cached fastapi-0.110.0-py3-none-any.whl.metadata (25 kB) Collecting uvicorn (from -r /Users/labixiaoshou/AI/ComfyUI/custom_nodes/Lora-Training-in-Comfy-main/requirements.txt (line 25)) Using cached uvicorn-0.28.0-py3-none-any.whl.metadata (6.3 kB) Collecting lion-pytorch (from -r /Users/labixiaoshou/AI/ComfyUI/custom_nodes/Lora-Training-in-Comfy-main/requirements.txt (line 26)) Using cached lion_pytorch-0.1.2-py3-none-any.whl.metadata (620 bytes) Collecting lycoris-lora (from -r /Users/labixiaoshou/AI/ComfyUI/custom_nodes/Lora-Training-in-Comfy-main/requirements.txt (line 27)) Using cached lycoris_lora-2.1.0.post3.tar.gz (86 kB) Installing build dependencies ... done Getting requirements to build wheel ... done Installing backend dependencies ... done Preparing metadata (pyproject.toml) ... done Collecting prodigyopt (from -r /Users/labixiaoshou/AI/ComfyUI/custom_nodes/Lora-Training-in-Comfy-main/requirements.txt (line 28)) Using cached prodigyopt-1.0-py3-none-any.whl.metadata (1.2 kB) WARNING: Retrying (Retry(total=4, connect=None, read=None, redirect=None, status=None)) after connection broken by 'ReadTimeoutError("HTTPSConnectionPool(host='pypi.org', port=443): Read timed out. (read timeout=15)")': /simple/dadaptation/ WARNING: Retrying (Retry(total=3, connect=None, read=None, redirect=None, status=None)) after connection broken by 'ReadTimeoutError("HTTPSConnectionPool(host='pypi.org', port=443): Read timed out. (read timeout=15)")': /simple/dadaptation/ WARNING: Retrying (Retry(total=2, connect=None, read=None, redirect=None, status=None)) after connection broken by 'ReadTimeoutError("HTTPSConnectionPool(host='pypi.org', port=443): Read timed out. (read timeout=15)")': /simple/dadaptation/ Collecting dadaptation (from -r /Users/labixiaoshou/AI/ComfyUI/custom_nodes/Lora-Training-in-Comfy-main/requirements.txt (line 29)) Using cached dadaptation-3.2.tar.gz (13 kB) Installing build dependencies ... done Getting requirements to build wheel ... done Preparing metadata (pyproject.toml) ... done Collecting wandb (from -r /Users/labixiaoshou/AI/ComfyUI/custom_nodes/Lora-Training-in-Comfy-main/requirements.txt (line 30)) Using cached wandb-0.16.4-py3-none-any.whl.metadata (10 kB) Collecting httpx (from -r /Users/labixiaoshou/AI/ComfyUI/custom_nodes/Lora-Training-in-Comfy-main/requirements.txt (line 31)) Using cached httpx-0.27.0-py3-none-any.whl.metadata (7.2 kB) Collecting xformers (from -r /Users/labixiaoshou/AI/ComfyUI/custom_nodes/Lora-Training-in-Comfy-main/requirements.txt (line 32)) Using cached xformers-0.0.24.tar.gz (3.9 MB) Installing build dependencies ... done Getting requirements to build wheel ... error error: subprocess-exited-with-error

× Getting requirements to build wheel did not run successfully. │ exit code: 1 ╰─> [20 lines of output] Traceback (most recent call last): File "/Library/Frameworks/Python.framework/Versions/3.11/lib/python3.11/site-packages/pip/_vendor/pyproject_hooks/_in_process/_in_process.py", line 353, in main() File "/Library/Frameworks/Python.framework/Versions/3.11/lib/python3.11/site-packages/pip/_vendor/pyproject_hooks/_in_process/_in_process.py", line 335, in main json_out['return_val'] = hook(**hook_input['kwargs']) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/Library/Frameworks/Python.framework/Versions/3.11/lib/python3.11/site-packages/pip/_vendor/pyproject_hooks/_in_process/_in_process.py", line 118, in get_requires_for_build_wheel return hook(config_settings) ^^^^^^^^^^^^^^^^^^^^^ File "/private/var/folders/_h/lf5vktdj5jvgn_q6fwnx1nzh0000gn/T/pip-build-env-ci09nx5m/overlay/lib/python3.11/site-packages/setuptools/build_meta.py", line 325, in get_requires_for_build_wheel return self._get_build_requires(config_settings, requirements=['wheel']) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/private/var/folders/_h/lf5vktdj5jvgn_q6fwnx1nzh0000gn/T/pip-build-env-ci09nx5m/overlay/lib/python3.11/site-packages/setuptools/build_meta.py", line 295, in _get_build_requires self.run_setup() File "/private/var/folders/_h/lf5vktdj5jvgn_q6fwnx1nzh0000gn/T/pip-build-env-ci09nx5m/overlay/lib/python3.11/site-packages/setuptools/build_meta.py", line 487, in run_setup super().run_setup(setup_script=setup_script) File "/private/var/folders/_h/lf5vktdj5jvgn_q6fwnx1nzh0000gn/T/pip-build-env-ci09nx5m/overlay/lib/python3.11/site-packages/setuptools/build_meta.py", line 311, in run_setup exec(code, locals()) File "", line 23, in ModuleNotFoundError: No module named 'torch' [end of output]

note: This error originates from a subprocess, and is likely not a problem with pip. error: subprocess-exited-with-error

× Getting requirements to build wheel did not run successfully. │ exit code: 1 ╰─> See above for output.

note: This error originates from a subprocess, and is likely not a problem with pip.

koppimashin commented 8 months ago

same problem with me

readycade commented 8 months ago

yep. broken. Piece of shit.

ThePowerOfElectricity commented 7 months ago

This error refers to the installation of the xFormers dependency. You can see this massive GitHub issue over on their side of things: https://github.com/facebookresearch/xformers/issues/740

I've now sunk countless hours into this issue as there is no adequate solution available... I didn't get a single step closer to a working install.

If you are here, my condolences.