comfyanonymous / ComfyUI

The most powerful and modular stable diffusion GUI, api and backend with a graph/nodes interface.
https://www.comfy.org/
GNU General Public License v3.0
42.93k stars 4.53k forks source link

ImportError: cannot import name 'get_full_repo_name' from 'huggingface_hub' #2055

Open Ryan-shadow opened 8 months ago

Ryan-shadow commented 8 months ago

Total VRAM 6144 MB, total RAM 32509 MB Traceback (most recent call last): File "F:\ai\ComfyUI-master\comfy\model_management.py", line 218, in import accelerate File "C:\Users\Ryan\AppData\Local\Programs\Python\Python311\Lib\site-packages\accelerate__init.py", line 3, in from .accelerator import Accelerator File "C:\Users\Ryan\AppData\Local\Programs\Python\Python311\Lib\site-packages\accelerate\accelerator.py", line 36, in from .checkpointing import load_accelerator_state, load_custom_state, save_accelerator_state, save_custom_state File "C:\Users\Ryan\AppData\Local\Programs\Python\Python311\Lib\site-packages\accelerate\checkpointing.py", line 24, in from .utils import ( File "C:\Users\Ryan\AppData\Local\Programs\Python\Python311\Lib\site-packages\accelerate\utils__init.py", line 148, in from .megatron_lm import ( File "C:\Users\Ryan\AppData\Local\Programs\Python\Python311\Lib\site-packages\accelerate\utils\megatron_lm.py", line 32, in from transformers.modeling_outputs import ( File "C:\Users\Ryan\AppData\Local\Programs\Python\Python311\Lib\site-packages\transformers__init__.py", line 26, in from . import dependency_versions_check File "C:\Users\Ryan\AppData\Local\Programs\Python\Python311\Lib\site-packages\transformers\dependency_versions_check.py", line 16, in from .utils.versions import require_version, require_version_core File "C:\Users\Ryan\AppData\Local\Programs\Python\Python311\Lib\site-packages\transformers\utils\init__.py", line 18, in from huggingface_hub import get_full_repo_name # for backward compatibility ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ImportError: cannot import name 'get_full_repo_name' from 'huggingface_hub' (C:\Users\Ryan\AppData\Local\Programs\Python\Python311\Lib\site-packages\huggingface_hub\init__.py)

ERROR: LOW VRAM MODE NEEDS accelerate. Set vram state to: NORMAL_VRAM Device: cuda:0 NVIDIA GeForce GTX 1660 SUPER : cudaMallocAsync VAE dtype: torch.float32 Traceback (most recent call last): File "F:\ai\ComfyUI-master\main.py", line 72, in import execution File "F:\ai\ComfyUI-master\execution.py", line 12, in import nodes File "F:\ai\ComfyUI-master\nodes.py", line 20, in import comfy.diffusers_load File "F:\ai\ComfyUI-master\comfy\diffusers_load.py", line 4, in import comfy.sd File "F:\ai\ComfyUI-master\comfy\sd.py", line 12, in from . import clip_vision File "F:\ai\ComfyUI-master\comfy\clip_vision.py", line 1, in from transformers import CLIPVisionModelWithProjection, CLIPVisionConfig, modeling_utils File "C:\Users\Ryan\AppData\Local\Programs\Python\Python311\Lib\site-packages\transformers__init.py", line 26, in from . import dependency_versions_check File "C:\Users\Ryan\AppData\Local\Programs\Python\Python311\Lib\site-packages\transformers\dependency_versions_check.py", line 16, in from .utils.versions import require_version, require_version_core File "C:\Users\Ryan\AppData\Local\Programs\Python\Python311\Lib\site-packages\transformers\utils__init__.py", line 18, in from huggingface_hub import get_full_repo_name # for backward compatibility ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ImportError: cannot import name 'get_full_repo_name' from 'huggingface_hub' (C:\Users\Ryan\AppData\Local\Programs\Python\Python311\Lib\site-packages\huggingface_hub\init__.py)

ChenDRAG commented 7 months ago

Have you resolve your issue? @Ryan-shadow

venshine commented 7 months ago

the same problem @comfyanonymous

huangyichun commented 7 months ago

the same problem

leavor commented 7 months ago

the same problem

ltdrdata commented 7 months ago

Based on the symptoms, it appears that the package dependency is tangled. Also, judging from the error message, it seems to be using the system Python. It is recommended to use the portable version or a venv instead.

aadityamundhalia commented 7 months ago

I got the same issue trying to run inside conda

ggriffin924 commented 7 months ago

Same issue here, running inside conda python 3.10 Anyone?

gayanechilingar commented 6 months ago

You can see: https://github.com/huggingface/transformers/issues/15062#issuecomment-1821349949 conda install chardet

mhdpr commented 6 months ago

I had the same problem and tried conda install chardet which didn't work. I solved problem using pip install transformers -U

harborn commented 6 months ago

still has problem: ImportError: cannot import name 'get_full_repo_name' from 'huggingface_hub' I have tried: conda install chardet and pip install transformers -U

bickramjitbasu09 commented 6 months ago

still has problem: ImportError: cannot import name 'get_full_repo_name' from 'huggingface_hub' I have tried: conda install chardet and pip install transformers -U

Tried this but still same error ? what is the issue ? anyone ?

ThistleInTheSun commented 5 months ago

try update requests,it works for me: pip install --upgrade requests

CrackerHax commented 4 months ago

try update requests,it works for me: pip install --upgrade requests

Ty, worked for me

kmuhan commented 3 months ago

pip install --upgrade requests did not works for me... I also uninstalled and reinstalled transformers module. still got ImportError: cannot import name 'get_full_repo_name' from 'huggingface_hub' (unknown location)

shlok55 commented 3 months ago

pip install --upgrade requests did not works for me... I also uninstalled and reinstalled transformers module. still got ImportError: cannot import name 'get_full_repo_name' from 'huggingface_hub'

it doesn't work for me , is there any other solutions for this ?

sgoede commented 3 months ago

pip install --upgrade transformers==4.39.2 worked for me. Environment with Python 3.12.2, just try to downgrade your version of the Transformers package.

lemo366 commented 3 months ago

pip3 install chardet, It works for me.

baojudezeze commented 3 months ago

I fixed using: conda install chardet

tttturtle-russ commented 3 months ago

I've tried following

conda install chardet
pip install -U transformers requests

still have the issue

gangtoe commented 2 months ago

pip install --upgrade huggingface-hub==0.22.2 worked for me.

dddwhy commented 2 months ago

I fixed using: 我修复了使用: conda install chardet

it works for me! i use conda!

franck-armand commented 2 months ago

conda install chardet should solve the problem.

Michael98Liu commented 1 month ago

Here is how I solved the error: conda install chardet pip install transformers -U

I encountered two subsequent dependency issues, which are solved by: pip install datasets==2.16.1 pip install pyarrow==12.0.1

officialsahyaboutorabi commented 1 month ago

I had the same problem but was able to fix it using: conda install chardet

Craze-H commented 1 month ago

I had the same problem but was able to fix it using: conda install chardet

i dont use conda. So i just try pip3 install chardet and it works.

starryMagician commented 1 month ago

conda install chardet also works for me.

unknownhl commented 1 month ago

Environment:
python 3.10.14 transformers 4.41.2

conda install chardet works for me.

saiteja-tally commented 4 weeks ago

Environment: python 3.10.14 transformers 4.41.2

conda install chardet didn't work for me.

ugritboon commented 2 weeks ago

You can see: huggingface/transformers#15062 (comment) conda install chardet

works for me.

whiletrue2009 commented 2 weeks ago

try update requests,it works for me: pip install --upgrade requests

works for me

tian-2024 commented 2 weeks ago

You can see: huggingface/transformers#15062 (comment) conda install chardet

useful!

leodeveloper commented 2 weeks ago

pip3 install chardet, It works for me.

RayminQAQ commented 6 days ago

pip3 install chardet, It works for me.

same for me in ubuntu system.

DawnMagnet commented 3 days ago

change from 3.11 to 3.9 will solve this