python应用运行时报错,部分信息如下:
Traceback (most recent call last):
File “D:\python\EchoMimic\webgui.py”, line 15, in
from diffusers import AutoencoderKL, DDIMScheduler
File “D:\python\EchoMimic\myenv\lib\site-packages\diffusers__init__.py”, line 5, in
from .utils import (
File “D:\python\EchoMimic\myenv\lib\site-packages\diffusers\utils__init__.py”, line 38, in
from .dynamic_modules_utils import get_class_from_dynamic_module
File “D:\python\EchoMimic\myenv\lib\site-packages\diffusers\utils\dynamic_modules_utils.py”, line 28, in
from huggingface_hub import HfFolder, cached_download, hf_hub_download, model_info
ImportError: cannot import name ‘cached_download’ from ‘huggingface_hub’ (D:\python\EchoMimic\myenv\lib\site-packages\huggingface_hub__init__.py)
报错说无法导入cached_download,原因是huggingface_hub新版本中没有cached_download了,所以无法导入
解决方法降低huggingface_hub版本,如降低到0.26以下
另一个方法就是修改代码删除cached_download,改成hf_hub_download