当我试图安装ruamel.yaml时,它会引发以下错误:
---> 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中使用的命令
RUN pip install ruamel.yaml
RUN pip install ruamel.yaml.jinja2发布于 2022-06-08 10:29:04
因为没有安装C编译器,所以会出现该错误。您可以做的一件事是确保安装了编译器,以便它能够编译ruamel.yaml.clib依赖项。
您正在安装ruamel.yaml车轮,我不明白为什么它没有为ruamel.yaml.clib安装车轮。这可能是由于体系结构或Python版本无法用于该体系结构造成的。
如果您的代码没有使用YAML(typ='safe')或其他实际使用C加载程序的内容,那么您也可以这样做:
RUN pip install --no-deps ruamel.yamlhttps://stackoverflow.com/questions/72543735
复制相似问题