ImportError: cannot import name ‘ftp_head‘ from ‘datasets.utils.file_utils‘ (C:\Users\27239\AppData\

 python调用包时报错,已经pip了modelscope包,不知道为啥

from modelscope.pipelines import pipeline

 报错如下,求大神解答

 下面是报错代码

---------------------------------------------------------------------------
ImportError                               Traceback (most recent call last)
Cell In[4], line 1
----> 1 from modelscope.pipelines import pipeline

File ~\AppData\Roaming\Python\Python311\site-packages\modelscope\pipelines\__init__.py:4
      1 # Copyright (c) Alibaba, Inc. and its affiliates.
      3 from . import audio, cv, multi_modal, nlp
----> 4 from .base import Pipeline
      5 from .builder import pipeline

File ~\AppData\Roaming\Python\Python311\site-packages\modelscope\pipelines\base.py:16
     13 from packaging import version
     15 from modelscope.models.base import Model
---> 16 from modelscope.msdatasets import MsDataset
     17 from modelscope.outputs import TASK_OUTPUTS, ModelOutputBase
     18 from modelscope.pipeline_inputs import TASK_INPUTS, check_input_type

File ~\AppData\Roaming\Python\Python311\site-packages\modelscope\msdatasets\__init__.py:2
      1 # Copyright (c) Alibaba, Inc. and its affiliates.
----> 2 from modelscope.msdatasets.ms_dataset import MsDataset

File ~\AppData\Roaming\Python\Python311\site-packages\modelscope\msdatasets\ms_dataset.py:24
     21 from modelscope.msdatasets.dataset_cls.custom_datasets.builder import \
     22     build_custom_dataset
     23 from modelscope.msdatasets.utils.delete_utils import DatasetDeleteManager
---> 24 from modelscope.msdatasets.utils.hf_datasets_util import load_dataset_with_ctx
     25 from modelscope.msdatasets.utils.upload_utils import DatasetUploadManager
     26 from modelscope.preprocessors import build_preprocessor

File ~\AppData\Roaming\Python\Python311\site-packages\modelscope\msdatasets\utils\hf_datasets_util.py:63
     61 from modelscope import HubApi
     62 from modelscope.hub.utils.utils import get_endpoint
---> 63 from modelscope.msdatasets.utils.hf_file_utils import get_from_cache_ms
     64 from modelscope.utils.config_ds import MS_DATASETS_CACHE
     65 from modelscope.utils.constant import DEFAULT_DATASET_NAMESPACE

File ~\AppData\Roaming\Python\Python311\site-packages\modelscope\msdatasets\utils\hf_file_utils.py:18
     15 import requests
     17 from datasets import config
---> 18 from datasets.utils.file_utils import hash_url_to_filename, get_authentication_headers_for_url, ftp_head, fsspec_head, \
     19     http_head, _raise_if_offline_mode_is_enabled, ftp_get, fsspec_get, http_get
     20 from filelock import FileLock
     22 from modelscope.utils.config_ds import MS_DATASETS_CACHE

ImportError: cannot import name 'ftp_head' from 'datasets.utils.file_utils' (C:\Users\27239\AppData\Roaming\Python\Python311\site-packages\datasets\utils\file_utils.py)

评论 4
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值