Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ComfyUI Installation Fails: "No module named 'torch'" #36

Open
madmanslullaby opened this issue Feb 3, 2025 · 1 comment
Open

ComfyUI Installation Fails: "No module named 'torch'" #36

madmanslullaby opened this issue Feb 3, 2025 · 1 comment

Comments

@madmanslullaby
Copy link

Fresh install of ComfyUI, followed the exact steps outlined in the readme, fails at the Install Dependencies step, with the following output:

(ComfyUI) PS C:\Users\madmanslullaby\Desktop\ComfyUI\custom_nodes\stable-point-aware-3d> pip install -r requirements.txt

Collecting git+https://github.com/openai/CLIP.git (from -r requirements.txt (line 6))
  Cloning https://github.com/openai/CLIP.git to c:\users\madmanslullaby\appdata\local\temp\pip-req-build-ftgr_2e0
  Running command git clone --filter=blob:none --quiet https://github.com/openai/CLIP.git 'C:\Users\madmanslullaby\AppData\Local\Temp\pip-req-build-ftgr_2e0'
  Resolved https://github.com/openai/CLIP.git to commit dcba3cb2e2827b402d2701e7e1c7d9fed8a20ef1
  Installing build dependencies ... done
  Getting requirements to build wheel ... done
  Preparing metadata (pyproject.toml) ... done
Collecting git+https://github.com/SunzeY/AlphaCLIP.git (from -r requirements.txt (line 7))
  Cloning https://github.com/SunzeY/AlphaCLIP.git to c:\users\madmanslullaby\appdata\local\temp\pip-req-build-0q29vxr7
  Running command git clone --filter=blob:none --quiet https://github.com/SunzeY/AlphaCLIP.git 'C:\Users\madmanslullaby\AppData\Local\Temp\pip-req-build-0q29vxr7'
  Resolved https://github.com/SunzeY/AlphaCLIP.git to commit 3457474356108988bed7f0354a5cfeeeb8322aeb
  Installing build dependencies ... done
  Getting requirements to build wheel ... done
  Preparing metadata (pyproject.toml) ... done
Processing c:\users\madmanslullaby\desktop\comfyui\custom_nodes\stable-point-aware-3d\texture_baker
  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
  ╰─> [23 lines of output]
      Traceback (most recent call last):
        File "C:\Python313\Lib\site-packages\pip\_vendor\pyproject_hooks\_in_process\_in_process.py", line 353, in <module>
          main()
          ~~~~^^
        File "C:\Python313\Lib\site-packages\pip\_vendor\pyproject_hooks\_in_process\_in_process.py", line 335, in main
          json_out['return_val'] = hook(**hook_input['kwargs'])
                                   ~~~~^^^^^^^^^^^^^^^^^^^^^^^^
        File "C:\Python313\Lib\site-packages\pip\_vendor\pyproject_hooks\_in_process\_in_process.py", line 118, in get_requires_for_build_wheel
          return hook(config_settings)
        File "C:\Users\madmanslullaby\AppData\Local\Temp\pip-build-env-tijc30_3\overlay\Lib\site-packages\setuptools\build_meta.py", line 334, in get_requires_for_build_wheel
          return self._get_build_requires(config_settings, requirements=[])
                 ~~~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
        File "C:\Users\madmanslullaby\AppData\Local\Temp\pip-build-env-tijc30_3\overlay\Lib\site-packages\setuptools\build_meta.py", line 304, in _get_build_requires
          self.run_setup()
          ~~~~~~~~~~~~~~^^
        File "C:\Users\madmanslullaby\AppData\Local\Temp\pip-build-env-tijc30_3\overlay\Lib\site-packages\setuptools\build_meta.py", line 522, in run_setup
          super().run_setup(setup_script=setup_script)
          ~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^
        File "C:\Users\madmanslullaby\AppData\Local\Temp\pip-build-env-tijc30_3\overlay\Lib\site-packages\setuptools\build_meta.py", line 320, in run_setup
          exec(code, locals())
          ~~~~^^^^^^^^^^^^^^^^
        File "<string>", line 5, in <module>
      ModuleNotFoundError: No module named 'torch'
      [end of output]

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

[notice] A new release of pip is available: 24.3.1 -> 25.0
[notice] To update, run: C:\Python313\python.exe -m pip install --upgrade 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.
@arkajyotimitra
Copy link

You can double check if there is torch installation in your environment, as they outline in their steps:

For example, if you have a cuda version 12.4 in your system, you can first install pytorch as such:

pip install torch==2.5.1 torchvision==0.20.1 torchaudio==2.5.1 --index-url https://download.pytorch.org/whl/cu124

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants