1

我想在没有编译器的环境中安装 ruamel.yaml,我不关心性能。

安装 ruamel.yaml w/o pip 尝试构建扩展并且无法执行未安装的 C 编译器的正确方法是什么?

我跑了

pip3 install ruamel.yaml

失败了

building '_ruamel_yaml' extension
creating build/temp.linux-x86_64-3.6
creating build/temp.linux-x86_64-3.6/ext
gcc -Wno-unused-result -Wsign-compare -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -Os -fomit-frame-pointer -g -Os -fomit-frame-pointer -g -Os -fomit-frame-pointer -g -DTHREAD_STACK_SIZE=0x100000 -fPIC -I/usr/include/python3.6m -c ext/_ruamel_yaml.c -o build/temp.linux-x86_64-3.6/ext/_ruamel_yaml.o
unable to execute 'gcc': No such file or directory
error: command 'gcc' failed with exit status 1

----------------------------------------
Command "/usr/bin/python3.6 -u -c "import setuptools, tokenize;__file__='/tmp/pip-install-myos8iv1/ruamel.yaml/setup.py';f=getattr(tokenize, 'open', open)(__file__);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, __file__, 'exec'))" install --record /tmp/pip-record-vuvr4aoi/install-record.txt --single-version-externally-managed --compile" failed with error code 1 in /tmp/pip-install-myos8iv1/ruamel.yaml/
4

1 回答 1

1

测试编译是否有效,如果没有则跳过编译 C 扩展,从ruamel.yaml不再依赖于libyaml可用时删除。

这当然并不意味着 C 编译器可用,所以这应该被认为是一种回归。在ruamel.yaml>=0.15.41这应该是固定的。

于 2018-06-27T07:52:53.040 回答