我想在我的pip项目中使用PyYaml,但是在将它用作依赖项时遇到了问题。 主要的问题是pip中的typyyaml不是跨平台安装的。
如何使用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依赖项工作我不只是想知道如何正确安装它。
如果这是不可能的,是否有任何图书馆我可以用来替代?
您需要一些额外的包来构建它。
首先,您需要卸载
pyyaml
,否则它稍后会抱怨它已经安装了然后安装以下软件包:
最后重新安装
相关问题 更多 >
编程相关推荐