我想在一个没有编译器的环境中安装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/发布于 2018-06-27 07:52:53
测试编译是否有效,如果编译不起作用,则跳过编译C扩展,当ruamel.yaml不再依赖于可用的libyaml时,就会从它中删除。
当然,这并不意味着C编译器是可用的,因此这应该被认为是一种回归。在ruamel.yaml>=0.15.41中,这应该是固定的。
https://stackoverflow.com/questions/51046012
复制相似问题