TypeError: MetadataPathFinder.invalidate_caches() missing 1 required positional argument: 'cls'
- Dominant language
- Python
- Stars
- 133k
- Forks
- 15.7k
- Avg merge
- 1d 7h
- Merged PRs (30d)
- 158
Description
### Expected Behavior
I trying to install comfyui on my macbookair m2 keep getting the following error. I attempted uninstalling and reinstalling using miniconda and pip with no luck. anyone experience this problem or have a fix?
### Actual Behavior
TypeError: MetadataPathFinder.invalidate_caches() missing 1 required positional argument: 'cls'
### Steps to Reproduce
python main.py
### Debug Logs
```powershell
Total VRAM 24576 MB, total RAM 24576 MB
pytorch version: 2.5.0
Set vram state to: SHARED
Device: mps
Traceback (most recent call last):
File "/Users/hollywoodeddie/Code/ComfyUI/main.py", line 90, in
import execution
File "/Users/hollywoodeddie/Code/ComfyUI/execution.py", line 13, in
import nodes
File "/Users/hollywoodeddie/Code/ComfyUI/nodes.py", line 21, in
import comfy.diffusers_load
File "/Users/hollywoodeddie/Code/ComfyUI/comfy/diffusers_load.py", line 3, in
import comfy.sd
File "/Users/hollywoodeddie/Code/ComfyUI/comfy/sd.py", line 8, in
from .ldm.cascade.stage_c_coder import StageC_coder
File "/Users/hollywoodeddie/Code/ComfyUI/comfy/ldm/cascade/stage_c_coder.py", line 19, in
import torchvision
File "/Users/hollywoodeddie/Library/Application Support/pypoetry/venv/lib/python3.11/site-packages/torchvision/__init__.py", line 10, in
from torchvision import _meta_registrations, datasets, io, models, ops, transforms, utils # usort:skip
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/Users/hollywoodeddie/Library/Application Support/pypoetry/venv/lib/python3.11/site-packages/torchvision/models/__init__.py", line 2, in
from .convnext import *
File "/Users/hollywoodeddie/Library/Application Support/pypoetry/venv/lib/python3.11/site-packages/torchvision/models/convnext.py", line 8, in
from ..ops.misc import Conv2dNormActivation, Permute
File "/Users/hollywoodeddie/Library/Application Support/pypoetry/venv/lib/python3.11/site-packages/torchvision/ops/__init__.py", line 23, in
from .poolers import MultiScaleRoIAlign
File "/Users/hollywoodeddie/Library/Application Support/pypoetry/venv/lib/python3.11/site-packages/torchvision/ops/poolers.py", line 10, in
from .roi_align import roi_align
File "/Users/hollywoodeddie/Library/Application Support/pypoetry/venv/lib/python3.11/site-packages/torchvision/ops/roi_align.py", line 7, in
from torch._dynamo.utils import is_compile_supported
File "/Users/hollywoodeddie/Library/Application Support/pypoetry/venv/lib/python3.11/site-packages/torch/_dynamo/__init__.py", line 3, in
from . import convert_frame, eval_frame, resume_execution
File "/Users/hollywoodeddie/Library/Application Support/pypoetry/venv/lib/python3.11/site-packages/torch/_dynamo/convert_frame.py", line 53, in
from . import config, exc, trace_rules
File "/Users/hollywoodeddie/Library/Application Support/pypoetry/venv/lib/python3.11/site-packages/torch/_dynamo/trace_rules.py", line 46, in
from .variables import (
File "/Users/hollywoodeddie/Library/Application Support/pypoetry/venv/lib/python3.11/site-packages/torch/_dynamo/variables/__init__.py", line 2, in
from .builtin import BuiltinVariable
File "/Users/hollywoodeddie/Library/Application Support/pypoetry/venv/lib/python3.11/site-packages/torch/_dynamo/variables/builtin.py", line 47, in
from .ctx_manager import EventVariable, StreamVariable
File "/Users/hollywoodeddie/Library/Application Support/pypoetry/venv/lib/python3.11/site-packages/torch/_dynamo/variables/ctx_manager.py", line 22, in
from .functions import (
File "/Users/hollywoodeddie/Library/Application Support/pypoetry/venv/lib/python3.11/site-packages/torch/_dynamo/variables/functions.py", line 31, in
from torch.distributed._composable.fsdp import _fsdp_param_group
File "/Users/hollywoodeddie/Library/Application Support/pypoetry/venv/lib/python3.11/site-packages/torch/distributed/_composable/__init__.py", line 3, in
from .fully_shard import fully_shard
File "/Users/hollywoodeddie/Library/Application Support/pypoetry/venv/lib/python3.11/site-packages/torch/distributed/_composable/fully_shard.py", line 10, in
from torch.distributed.fsdp._common_utils import _FSDPState
File "/Users/hollywoodeddie/Library/Application Support/pypoetry/venv/lib/python3.11/site-packages/torch/distributed/fsdp/__init__.py", line 1, in
from ._flat_param import FlatParameter as FlatParameter
File "/Users/hollywoodeddie/Library/Application Support/pypoetry/venv/lib/python3.11/site-packages/torch/distributed/fsdp/_flat_param.py", line 47, in
from ._fsdp_extensions import (
File "/Users/hollywoodeddie/Library/Application Support/pypoetry/venv/lib/python3.11/site-packages/torch/distributed/fsdp/_fsdp_extensions.py", line 6, in
from torch.distributed._shard.sharded_tensor.api import ShardedTensor
File "/Users/hollywoodeddie/Library/Application Support/pypoetry/venv/lib/python3.11/site-packages/torch/distributed/_shard/__init__.py", line 1, in
from .api import _shard_tensor, load_with_process_group, shard_module, shard_parameter
File "/Users/hollywoodeddie/Library/Application Support/pypoetry/venv/lib/python3.11/site-packages/torch/distributed/_shard/api.py", line 9, in
from torch.distributed._shard.sharded_tensor import ShardedTensor
File "/Users/hollywoodeddie/Library/Application Support/pypoetry/venv/lib/python3.11/site-packages/torch/distributed/_shard/sharded_tensor/__init__.py", line 8, in
from .api import (
File "/Users/hollywoodeddie/Library/Application Support/pypoetry/venv/lib/python3.11/site-packages/torch/distributed/_shard/sharded_tensor/api.py", line 31, in
from .reshard import reshard_local_shard, reshuffle_local_shard
File "/Users/hollywoodeddie/Library/Application Support/pypoetry/venv/lib/python3.11/site-packages/torch/distributed/_shard/sharded_tensor/reshard.py", line 14, in
from torch.distributed.nn.functional import all_to_all, all_to_all_single
File "/Users/hollywoodeddie/Library/Application Support/pypoetry/venv/lib/python3.11/site-packages/torch/distributed/nn/__init__.py", line 7, in
from .api.remote_module import RemoteModule
File "/Users/hollywoodeddie/Library/Application Support/pypoetry/venv/lib/python3.11/site-packages/torch/distributed/nn/api/remote_module.py", line 42, in
instantiator.instantiate_non_scriptable_remote_module_template()
File "/Users/hollywoodeddie/Library/Application Support/pypoetry/venv/lib/python3.11/site-packages/torch/distributed/nn/jit/instantiator.py", line 154, in instantiate_non_scriptable_remote_module_template
return _do_instantiate_remote_module_template(generated_module_name, str_dict, True)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/Users/hollywoodeddie/Library/Application Support/pypoetry/venv/lib/python3.11/site-packages/torch/distributed/nn/jit/instantiator.py", line 95, in _do_instantiate_remote_module_template
importlib.invalidate_caches()
File "/opt/miniconda3/lib/python3.11/importlib/__init__.py", line 70, in invalidate_caches
finder.invalidate_caches()
File "", line 1409, in invalidate_caches
TypeError: MetadataPathFinder.invalidate_caches() missing 1 required positional argument: 'cls'
```
### Other
_No response_
Contributor guide
Assessment
This issue has not been assessed yet.