安装Paddlehub报错

我在安装Paddlehub时遇到了各种报错,我遇到的主要遇到以下错误, subprocess-exited-with-error以及 metadata-generation-failed。

其实在报错中就给出了解决方法,但是我没有注意...因此还浪费了很多时间,其实只要加上--use-

pep517就可以了。

bash 复制代码
  Preparing metadata (setup.py) ... done
Collecting seqeval (from paddlenlp>=2.0.0->paddlehub==2.3.0)
  Using cached http://mirrors.aliyun.com/pypi/packages/9d/2d/233c79d5b4e5ab1dbf111242299153f3caddddbb691219f363ad55ce783d/seqeval-1.2.2.tar.gz (43 kB)
  Preparing metadata (setup.py) ... error
  error: subprocess-exited-with-error
  
  _ python setup.py egg_info did not run successfully.
  _ exit code: 1
  __> [48 lines of output]
      WARNING: The repository located at mirrors.aliyun.com is not a trusted or secure host and is being ignored. If this repository is available via HTTPS we recommend you use HTTPS instead, otherwise you may silence this warning and allow it anyway with '--trusted-host mirrors.aliyun.com'.
      ERROR: Could not find a version that satisfies the requirement setuptools_scm (from versions: none)
      ERROR: No matching distribution found for setuptools_scm
      /opt/data/private/anaconda3/envs/paddle_hrsegnet/lib/python3.8/site-packages/setuptools/__init__.py:80: _DeprecatedInstaller: setuptools.installer and fetch_build_eggs are deprecated.
      !!
      
              ********************************************************************************
              Requirements should be satisfied by a PEP 517 installer.
              If you are using pip, you can try `pip install --use-pep517`.
              ********************************************************************************
      
      !!
        dist.fetch_build_eggs(dist.setup_requires)
      Traceback (most recent call last):
        File "/opt/data/private/anaconda3/envs/paddle_hrsegnet/lib/python3.8/site-packages/setuptools/installer.py", line 101, in _fetch_build_egg_no_warn
          subprocess.check_call(cmd)
        File "/opt/data/private/anaconda3/envs/paddle_hrsegnet/lib/python3.8/subprocess.py", line 364, in check_call
          raise CalledProcessError(retcode, cmd)
      subprocess.CalledProcessError: Command '['/opt/data/private/anaconda3/envs/paddle_hrsegnet/bin/python3.8', '-m', 'pip', '--disable-pip-version-check', 'wheel', '--no-deps', '-w', '/tmp/tmpr05krkvk', '--quiet', 'setuptools_scm']' returned non-zero exit status 1.
      

        File "<pip-setuptools-caller>", line 34, in <module>
        File "/tmp/pip-install-6x288_4j/seqeval_5a6ef0cdabf24d6dab49069c1ddaef00/setup.py", line 27, in <module>
          setup(
        File "/opt/data/private/anaconda3/envs/paddle_hrsegnet/lib/python3.8/site-packages/setuptools/__init__.py", line 102, in setup
          _install_setup_requires(attrs)
        File "/opt/data/private/anaconda3/envs/paddle_hrsegnet/lib/python3.8/site-packages/setuptools/__init__.py", line 75, in _install_setup_requires
          _fetch_build_eggs(dist)
        File "/opt/data/private/anaconda3/envs/paddle_hrsegnet/lib/python3.8/site-packages/setuptools/__init__.py", line 80, in _fetch_build_eggs
          dist.fetch_build_eggs(dist.setup_requires)
        File "/opt/data/private/anaconda3/envs/paddle_hrsegnet/lib/python3.8/site-packages/setuptools/dist.py", line 636, in fetch_build_eggs
          return _fetch_build_eggs(self, requires)
        File "/opt/data/private/anaconda3/envs/paddle_hrsegnet/lib/python3.8/site-packages/setuptools/installer.py", line 38, in _fetch_build_eggs
          resolved_dists = pkg_resources.working_set.resolve(
        File "/opt/data/private/anaconda3/envs/paddle_hrsegnet/lib/python3.8/site-packages/pkg_resources/__init__.py", line 829, in resolve
          dist = self._resolve_dist(
        File "/opt/data/private/anaconda3/envs/paddle_hrsegnet/lib/python3.8/site-packages/pkg_resources/__init__.py", line 865, in _resolve_dist
          dist = best[req.key] = env.best_match(
        File "/opt/data/private/anaconda3/envs/paddle_hrsegnet/lib/python3.8/site-packages/pkg_resources/__init__.py", line 1135, in best_match
          return self.obtain(req, installer)
        File "/opt/data/private/anaconda3/envs/paddle_hrsegnet/lib/python3.8/site-packages/pkg_resources/__init__.py", line 1147, in obtain
          return installer(requirement)
        File "/opt/data/private/anaconda3/envs/paddle_hrsegnet/lib/python3.8/site-packages/setuptools/installer.py", line 103, in _fetch_build_egg_no_warn
          raise DistutilsError(str(e)) from e
      distutils.errors.DistutilsError: Command '['/opt/data/private/anaconda3/envs/paddle_hrsegnet/bin/python3.8', '-m', 'pip', '--disable-pip-version-check', 'wheel', '--no-deps', '-w', '/tmp/tmpr05krkvk', '--quiet', 'setuptools_scm']' returned non-zero exit status 1.
      [end of output]
  
  note: This error originates from a subprocess, and is likely not a problem with pip.
error: metadata-generation-failed

_ Encountered error while generating package metadata.
__> See above for output.

note: This is an issue with the package mentioned above, not pip.
hint: See above for details.
bash 复制代码
pip cache purge 

pip install --use-pep517 paddlehub -i https://mirror.baidu.com/pypi/simple
相关推荐
汤姆_5111 分钟前
【c语言】深入理解指针1
c语言·开发语言
人猿泰飞4 分钟前
在Ubuntu-22.04.5中安装ONLYOFFICE DocSpace(协作空间)【注意:安装失败,谨慎参考!】
java·linux·运维·python·ubuntu·项目管理·onlyoffice
gospace7 分钟前
Golang Event Bus 最佳实践:使用 NSQite 实现松耦合架构
开发语言·架构·golang·事件·总线·event·event bus
Enougme10 分钟前
python-将文本生成音频
python·音视频·语音识别
风中飘爻13 分钟前
JavaScript:表单及正则表达式验证
开发语言·javascript·ecmascript
极客先躯32 分钟前
高级java每日一道面试题-2025年4月07日-微服务篇[Nacos篇]-如何监控Nacos的运行状态?
java·开发语言·微服务
拖拉机35 分钟前
Python(八)类(下)
后端·python
牛了爷爷41 分钟前
php伪协议
android·开发语言·php
CSUC1 小时前
【开发语言】悬空指针问题
开发语言
晓13131 小时前
第三章 爬虫提速、selenium模块、requests模块进阶(终)
爬虫·python·selenium·测试工具·http