安装Paddlehub报错

发布时间:2023年12月27日

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

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

  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.

pip cache purge 

pip install --use-pep517 paddlehub -i https://mirror.baidu.com/pypi/simple
文章来源:https://blog.csdn.net/qq_22762933/article/details/135231938
本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。