如何安装 ruamel.yaml w/o 本机扩展
How to install ruamel.yaml w/o native extension
我想在没有编译器的环境中安装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/
测试编译是否有效并跳过编译 C 扩展(如果无效)已从 ruamel.yaml
中删除,因为它不再依赖于 libyaml
是否可用。
当然这并不意味着 C 编译器可用,因此这应该被视为一种回归。在 ruamel.yaml>=0.15.41
中,这应该是固定的。
我想在没有编译器的环境中安装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/
测试编译是否有效并跳过编译 C 扩展(如果无效)已从 ruamel.yaml
中删除,因为它不再依赖于 libyaml
是否可用。
当然这并不意味着 C 编译器可用,因此这应该被视为一种回归。在 ruamel.yaml>=0.15.41
中,这应该是固定的。