首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >安装ruamel.yaml时面临的问题

安装ruamel.yaml时面临的问题
EN

Stack Overflow用户
提问于 2022-06-08 10:01:20
回答 1查看 487关注 0票数 1

当我试图安装ruamel.yaml时,它会引发以下错误:

代码语言:javascript
复制
 ---> Running in 71801483b5a1
Collecting ruamel.yaml
  Downloading ruamel.yaml-0.17.21-py3-none-any.whl (109 kB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 109.5/109.5 kB 12.3 MB/s eta 0:00:00
Collecting ruamel.yaml.clib>=0.2.6
  Downloading ruamel.yaml.clib-0.2.6.tar.gz (180 kB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 180.7/180.7 kB 21.5 MB/s eta 0:00:00
  Preparing metadata (setup.py): started
  Preparing metadata (setup.py): finished with status 'error'
[91m  error: subprocess-exited-with-error
  
  × python setup.py egg_info did not run successfully.
  │ exit code: 1
  ╰─> [3 lines of output]
      sys.argv ['/tmp/pip-install-4z0awj5u/ruamel-yaml-clib_ebca93f6ff92409a86d7beb1a0f1b92c/setup.py', 'egg_info', '--egg-base', '/tmp/pip-pip-egg-info-odj056w3']
      test compiling /tmp/tmp_ruamel_ua_v5oye/test_ruamel_yaml.c -> test_ruamel_yaml compile error: /tmp/tmp_ruamel_ua_v5oye/test_ruamel_yaml.c
      Exception: command 'gcc' failed: No such file or directory
      [end of output]
  
  note: This error originates from a subprocess, and is likely not a problem with pip.
[0m[91merror: 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.

它以前起作用了。我正在使用docker,下面是在Dockerfile中使用的命令

代码语言:javascript
复制
RUN pip install ruamel.yaml
RUN pip install ruamel.yaml.jinja2
EN

回答 1

Stack Overflow用户

回答已采纳

发布于 2022-06-08 10:29:04

因为没有安装C编译器,所以会出现该错误。您可以做的一件事是确保安装了编译器,以便它能够编译ruamel.yaml.clib依赖项。

您正在安装ruamel.yaml车轮,我不明白为什么它没有为ruamel.yaml.clib安装车轮。这可能是由于体系结构或Python版本无法用于该体系结构造成的。

如果您的代码没有使用YAML(typ='safe')或其他实际使用C加载程序的内容,那么您也可以这样做:

代码语言:javascript
复制
RUN pip install --no-deps ruamel.yaml
票数 1
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/72543735

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档