I was trying to use easy_install to install pyyaml on Suse linux. I get the following output:
sudo easy_install pyyaml
root's password:
Searching for pyyaml
Reading https://pypi.python.org/simple/pyyaml/
Best match: PyYAML 3.11
Downloading https://pypi.python.org/packages/source/P/PyYAML/PyYAML-3.11.zip#md5=89cbc92cda979042533b640b76e6e055
Processing PyYAML-3.11.zip
Writing /tmp/easy_install-51ghymsa/PyYAML-3.11/setup.cfg
Running PyYAML-3.11/setup.py -q bdist_egg --dist-dir /tmp/easy_install-51ghymsa/PyYAML-3.11/egg-dist-tmp-3neiipqa
ext/_yaml.c:16:20: fatal error: Python.h: No such file or directory
#include "Python.h"
^
compilation terminated.
error: Setup script exited with error: command 'gcc' failed with exit status 1
I installed python-devel, and "locate Python.h" gives "/usr/include/python2.7/Python.h". I just can't find how to make easy_install see it. I appreciate any help on this!
Update: trying to install with pip instead of easy_install, I see that gcc is using the wrong include-dirs: /usr/include/python3.4m instead of /usr/include/python2.7. I tried running
sudo pip install --global-option=build_ext --global-option="-I/usr/include/python2.7" pyyaml
But this just makes gcc run with include dirs set to both python2.7 and 3.4m which creates its own problems. Setting CPLUS_INCLUDE_PATH and C_INCLUDE_PATH to /usr/include/python2.7 does not seem to make any difference.