开发者社区 > 云原生 > Serverless > 正文

在函数计算FC中python的依赖层在线构建会爆这个问题,怎么解决 ?

在函数计算FC中python的依赖层在线构建会爆这个问题,怎么解决?lQLPJxBbKWIDIYPNAzTNB1mwGnBrPiPEXiUFYikoweiTAA_1881_820.png
error: subprocess-exited-with-error

× python setup.py egg_info did not run successfully.
│ exit code: 1
╰─> [34 lines of output]
WARNING: The repository located at mirrors.cloud.aliyuncs.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.cloud.aliyuncs.com'.
ERROR: Could not find a version that satisfies the requirement setuptools_scm (from versions: none)
ERROR: No matching distribution found for setuptools_scm
Traceback (most recent call last):
File "/opt/python3.10/lib/python3.10/site-packages/setuptools/installer.py", line 75, in fetch_build_egg
subprocess.check_call(cmd)
File "/opt/python3.10/lib/python3.10/subprocess.py", line 369, in check_call
raise CalledProcessError(retcode, cmd)
subprocess.CalledProcessError: Command '['/opt/python3.10/bin/python3', '-m', 'pip', '--disable-pip-version-check', 'wheel', '--no-deps', '-w', '/tmp/tmprs3hwf4g', '--quiet', 'setuptools_scm']' returned non-zero exit status 1.

  The above exception was the direct cause of the following exception:

  Traceback (most recent call last):
    File "<string>", line 2, in <module>
    File "<pip-setuptools-caller>", line 34, in <module>
    File "/tmp/pip-install-_in3pq3r/seqeval_e3fb1e2478af4fa293408a87e26c6100/setup.py", line 27, in <module>
      setup(
    File "/opt/python3.10/lib/python3.10/site-packages/setuptools/__init__.py", line 152, in setup
      _install_setup_requires(attrs)
    File "/opt/python3.10/lib/python3.10/site-packages/setuptools/__init__.py", line 147, in _install_setup_requires
      dist.fetch_build_eggs(dist.setup_requires)
    File "/opt/python3.10/lib/python3.10/site-packages/setuptools/dist.py", line 806, in fetch_build_eggs
      resolved_dists = pkg_resources.working_set.resolve(
    File "/opt/python3.10/lib/python3.10/site-packages/pkg_resources/__init__.py", line 766, in resolve
      dist = best[req.key] = env.best_match(
    File "/opt/python3.10/lib/python3.10/site-packages/pkg_resources/__init__.py", line 1051, in best_match
      return self.obtain(req, installer)
    File "/opt/python3.10/lib/python3.10/site-packages/pkg_resources/__init__.py", line 1063, in obtain
      return installer(requirement)
    File "/opt/python3.10/lib/python3.10/site-packages/setuptools/dist.py", line 877, in fetch_build_egg
      return fetch_build_egg(self, req)
    File "/opt/python3.10/lib/python3.10/site-packages/setuptools/installer.py", line 77, in fetch_build_egg
      raise DistutilsError(str(e)) from e
  distutils.errors.DistutilsError: Command '['/opt/python3.10/bin/python3', '-m', 'pip', '--disable-pip-version-check', 'wheel', '--no-deps', '-w', '/tmp/tmprs3hwf4g', '--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.

展开
收起
三分钟热度的鱼 2023-12-13 19:09:55 32 0
1 条回答
写回答
取消 提交回答
  • 面对过去,不要迷离;面对未来,不必彷徨;活在今天,你只要把自己完全展示给别人看。

    这个问题是由于在构建Python依赖层时,找不到setuptools_scm包导致的。你可以尝试以下方法解决这个问题:

    1. 确保你的网络连接正常,可以访问外部仓库。
    2. 更新pip和setuptools到最新版本。你可以使用以下命令进行更新:
    pip install --upgrade pip setuptools
    
    1. 如果问题仍然存在,尝试手动安装setuptools_scm包。首先,从GitHub上克隆setuptools_scm仓库:
    git clone https://github.com/pypa/setuptools_scm.git
    

    然后,进入仓库目录并安装setuptools_scm:

    cd setuptools_scm
    python setup.py install
    
    2023-12-15 15:35:27
    赞同 展开评论 打赏

快速交付实现商业价值。

相关产品

  • 函数计算
  • 相关电子书

    更多
    All in Serverless 阿里云核心产品全面升级 立即下载
    AIGC 浪潮之上,森马的 Serverless 实践之旅 立即下载
    极氪大数据 Serverless 应用实践 立即下载