Skip to content

PyYAML using easy_install on Mac OS X (Lion)

Tried to install pyyaml today but got a couple nasty errors.

$ sudo easy_install  pyyaml
Searching for pyyaml
Best match: PyYAML 3.10
Running PyYAML-3.10/ -q bdist_egg --dist-dir /tmp/easy_install-8Co0C6/PyYAML-3.10/egg-dist-tmp-FYdiLy
build/temp.macosx-10.7-intel-2.7/check_libyaml.c:2:18: error: yaml.h: No such file or directory
build/temp.macosx-10.7-intel-2.7/check_libyaml.c: In function ‘main’:
build/temp.macosx-10.7-intel-2.7/check_libyaml.c:5: error: ‘yaml_parser_t’ undeclared (first use in this function)
lipo: can't open input file: /var/tmp//ccxDQipT.out (No such file or directory)


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)

Fortunately, after piecing together a couple posts, the fix is easy. Use the following command to install PyYAML.

sudo python -m easy_install pyyaml

We must install this way because the problem is a bug in an Python’s setuptools. Its been fixed in later versions, but for now this did the trick for me.



Posted in Tutorials.

2 Responses

Stay in touch with the conversation, subscribe to the RSS feed for comments on this post.

  1. futanow says

    Hi , i have used your method.
    sudo python -m easy_install pyyaml
    /usr/bin/python: No module named easy_install

  2. codyaray says

    Sounds like you need to install easy_install itself first.

Some HTML is OK

or, reply to this post via trackback.


Log in here!