ComfyUI
ComfyUI copied to clipboard
Error when running main.py
File "/Library/Frameworks/Python.framework/Versions/3.12/lib/python3.12/site-packages/sympy/core/numbers.py", line 4567, in <module> _sympy_converter[type(mpmath.rational.mpq(1, 2))] = sympify_mpmath_mpq ^^^^^^^^^^^^^^^ AttributeError: module 'mpmath' has no attribute 'rational'
This is an issue that occurred outside the scope of ComfyUI, so we can't grasp anything from this. You need to provide the full log for us to at least guide you in the right direction.
I found a solution. It's because of an alpha version of mpmath (1.4.0a0) as dependency.
sudo pip3 install mpmath==1.3.0 reverting to 1.3.0 fixes the bug
You might want to look into setting up a virtual environment such that you don't need to run everything with the system python.
Running in the same problem. This happens when you install you'r venv according to the linked apple site.
mps-pytorch ❯ pip3 list
Package Version
------------------ ------------------
aiohttp 3.9.3
aiosignal 1.3.1
attrs 23.2.0
certifi 2024.2.2
charset-normalizer 3.3.2
einops 0.7.0
filelock 3.13.1
frozenlist 1.4.1
fsspec 2024.3.0
huggingface-hub 0.21.4
idna 3.6
Jinja2 3.1.3
kornia 0.7.2
kornia_rs 0.1.2
MarkupSafe 2.1.5
mpmath 1.4.0a0
multidict 6.0.5
networkx 3.2.1
numpy 1.26.4
packaging 24.0
pillow 10.2.0
pip 24.0
psutil 5.9.8
PyYAML 6.0.1
regex 2023.12.25
requests 2.31.0
safetensors 0.4.2
scipy 1.12.0
sympy 1.12
tokenizers 0.15.2
torch 2.4.0.dev20240318
torchaudio 2.2.0.dev20240318
torchsde 0.2.6
torchvision 0.18.0.dev20240318
tqdm 4.66.2
trampoline 0.1.2
transformers 4.38.2
typing_extensions 4.10.0
urllib3 2.2.1
yarl 1.9.4
is there anything else fishy?
force 1.3.0 version pip install mpmath==1.3.0
Just as a general word of advice:
Using pip via python -m pip instead of just pip can reduce problems since it ensures that pip is invoked within the currently active python environment instead of whatever is found in $PATH.