我想在我的pip项目中使用PyYaml,但是在使用它作为依赖项时遇到了麻烦.主要问题是pip中的PyYaml不是跨平台安装.
如何使用pip安装pyyaml以使其正常工作.注意,在当前新的Ubuntu安装上,运行时出现以下错误pip install pyyaml
Installing collected packages: pyyaml Running setup.py install for pyyaml checking if libyaml is compilable gcc -pthread -DNDEBUG -g -fwrapv -O2 -Wall -Wstrict-prototypes -g -fstack-protector --param=ssp-buffer-size=4 -Wformat -Wformat-security -Werror=format-security -fPIC -I/usr/include/python3.2mu -c build/temp.linux-x86_64-3.2/check_libyaml.c -o build/temp.linux-x86_64-3.2/check_libyaml.o build/temp.linux-x86_64-3.2/check_libyaml.c:2:18: fatal error: yaml.h: No such file or directory compilation terminated. libyaml is not found or a compiler error: forcing --without-libyaml (if libyaml is installed correctly, you may need to specify the option --include-dirs or uncomment and modify the parameter include_dirs in setup.cfg) Successfully installed pyyaml
请注意,错误显示"已成功安装",但事实并非如此.我不能import yaml
由于我的第一句话,我不是在寻找说"使用apt-get"的答案.我需要安装是跨平台的,并作为一个pip依赖工作我不是简单地想知道如何正确安装它.
如果这是不可能的,我可以使用任何替换库吗?