RuntimeError: Failed to find C compiler. Please specify via CC environment variable.
Your question
It's about the TorchCompileModel node.
backend='inductor' raised:
RuntimeError: Failed to find C compiler. Please specify via CC environment variable.
What should I do to the system PATH?
Logs
No response
Other
No response
Unfortunately, that feature is only guaranteed to work on Linux.
You need to set both the path to your VS installation and the C compiler path.
For example:
The CC environment variable set to (with cl.exe at the end):
C:\Program Files\Microsoft Visual Studio\2022\Community\VC\Tools\MSVC\14.43.34808\bin\Hostx64\x64\cl.exe
In your PATH environment variable include (no cl.exe at the end):
C:\Program Files\Microsoft Visual Studio\2022\Community\VC\Tools\MSVC\14.43.34808\bin\Hostx64\x64
This fixed it for me.
I had the same problem. I wanted to ask where I should go to change the path. I'm sorry, but I don't understand some computer things very well, and I would appreciate your help.
@Lyao0915 you need to go to the environment variables settings on Windows. Open the start menu and just type "env" - This should bring up a link to your settings
In your settings you will find two different configurations. One for your current user account, one for the system wide variables. I suggest you update the one for your user account settings. In the list of user variables double click the one called "PATH". Then add the path to your VC compiler to the list of values. After you added the PATH, you can create a new environment variable called "CC" and add the path to the compiler binary.
Your path is most likely different from mine, so you need to check the correct path for your system. Don't just copy mine!
Thanks so much!!!!!!!!!!!!!!! it works!!!!!!!!!!!!!!! That helps a lot!!!!!
Im a comfyui and python newbie so sorry for the dumb questions but you guys seem to have the solution but when I try and update system environment variables the way Andypotato decscribed very well, I still manage to screw it up. I pasted some pics of my error message from ComfyUI and screenshot of environment settings. I made sure my path to VC was correct, then added a new environment variable called "CC" and pasted the path the cl.exe(from VC directory). Still getting this error. Triton, Cuda, etc all seem to be installed correctly and load fine. Not sure what Im missing...any help would be hugely appreciated!!! First post at github! definitely will be posting and reading up on latest here, seems like a great resource!
![]()
Im a comfyui and python newbie so sorry for the dumb questions but you guys seem to have the solution but when I try and update system environment variables the way Andypotato decscribed very well, I still manage to screw it up. I pasted some pics of my error message from ComfyUI and screenshot of environment settings. I made sure my path to VC was correct, then added a new environment variable called "CC" and pasted the path the cl.exe(from VC directory). Still getting this error. Triton, Cuda, etc all seem to be installed correctly and load fine. Not sure what Im missing...any help would be hugely appreciated!!! First post at github! definitely will be posting and reading up on latest here, seems like a great resource!
I had a same issues and i did the same thing as you did. And it worked. Only thing i additionally do is, download and install the microsoft visual studio 2022. You might need to update comfyui and all dependicies using the script inside the comfyui portable update folder. Maybe it might help.