Issue #10 resolved

_yaml.c file missing

ge045
created an issue

I tried to get pyyaml installed with libyaml.

Compiling libyaml worked fine.

setup.cfg is configured to find the include and lib dir i.e. it looks similar to this:

include_dirs=C:\...\xi-libyaml-3e6507fa0c26\include
library_dirs=C:\...\xi-libyaml-3e6507fa0c26\win32\vs2008\Output\Release\lib
define=YAML_DECLARE_STATIC

running then

python setup.py --with-libyaml build -f

Leads to this output:

running build
running build_py
creating build
creating build\lib.win-amd64-2.7
creating build\lib.win-amd64-2.7\yaml
copying lib\yaml\composer.py -> build\lib.win-amd64-2.7\yaml
copying lib\yaml\constructor.py -> build\lib.win-amd64-2.7\yaml
copying lib\yaml\cyaml.py -> build\lib.win-amd64-2.7\yaml
copying lib\yaml\dumper.py -> build\lib.win-amd64-2.7\yaml
copying lib\yaml\emitter.py -> build\lib.win-amd64-2.7\yaml
copying lib\yaml\error.py -> build\lib.win-amd64-2.7\yaml
copying lib\yaml\events.py -> build\lib.win-amd64-2.7\yaml
copying lib\yaml\loader.py -> build\lib.win-amd64-2.7\yaml
copying lib\yaml\nodes.py -> build\lib.win-amd64-2.7\yaml
copying lib\yaml\parser.py -> build\lib.win-amd64-2.7\yaml
copying lib\yaml\reader.py -> build\lib.win-amd64-2.7\yaml
copying lib\yaml\representer.py -> build\lib.win-amd64-2.7\yaml
copying lib\yaml\resolver.py -> build\lib.win-amd64-2.7\yaml
copying lib\yaml\scanner.py -> build\lib.win-amd64-2.7\yaml
copying lib\yaml\serializer.py -> build\lib.win-amd64-2.7\yaml
copying lib\yaml\tokens.py -> build\lib.win-amd64-2.7\yaml
copying lib\yaml\__init__.py -> build\lib.win-amd64-2.7\yaml
running build_ext
building '_yaml' extension
creating build\temp.win-amd64-2.7
creating build\temp.win-amd64-2.7\Release
creating build\temp.win-amd64-2.7\Release\ext
C:\Program Files (x86)\Microsoft Visual Studio 9.0\VC\BIN\amd64\cl.exe /c /nologo /Ox /MD /W3 /GS- /DNDEBUG -DYAML_DECLARE_STATIC=1 -IC:\...\xi-libyaml-3e6507fa0c26\include -IC:\Python27\include -IC:\Python27\PC /Tcext/_yaml.c /Fobuild\temp.win-amd64-2.7\Release\ext/_yaml.obj _yaml.c
c1 : fatal error C1083: Cannot open source file: 'ext/_yaml.c': No such file or directory
error: command '"C:\Program Files (x86)\Microsoft Visual Studio 9.0\VC\BIN\amd64\cl.exe"' failed with exit status 2

I have a similar result on a Mac using the clang compiler.

(Maybe I simply missed the part in the documentation that explains how the _yaml.c file is generated?)

Comments (4)

  1. Filip Zyzniewski

    I had the same problem when I did not have cython installed - the files in ext/ were not preprocessed into _yaml.c, the process failed silently.

    I also had this problem after installing cython when I tried building for python3 first - I had to call python setup.py build_ext ; python3 setup.py build_ext, not the other way around.

  2. ge045 reporter

    Yes! you right. Installing Cython solved the missing _yaml.c issue. Now the linker crashes (see below). I think I am giving up on this. Anyway pyyaml without libyaml is fast enough for my application

    _yaml.obj : error LNK2019: unresolved external symbol __imp__yaml_event_delete referenced in function ___pyx_pf_5_yaml_7CParser_2__dealloc__
    _yaml.obj : error LNK2019: unresolved external symbol __imp__yaml_parser_delete referenced in function ___pyx_pf_5_yaml_7CParser_2__dealloc__
    _yaml.obj : error LNK2019: unresolved external symbol __imp__yaml_emitter_delete referenced in function ___pyx_pf_5_yaml_8CEmitter_2__dealloc__
    _yaml.obj : error LNK2019: unresolved external symbol __imp__yaml_get_version_string referenced in function ___pyx_pf_5_yaml_get_version_string
    _yaml.obj : error LNK2019: unresolved external symbol __imp__yaml_get_version referenced in function ___pyx_pf_5_yaml_2get_version
    _yaml.obj : error LNK2019: unresolved external symbol __imp__yaml_token_delete referenced in function ___pyx_pf_5_yaml_7CParser_6raw_scan
    _yaml.obj : error LNK2019: unresolved external symbol __imp__yaml_parser_scan referenced in function ___pyx_pf_5_yaml_7CParser_6raw_scan
    _yaml.obj : error LNK2019: unresolved external symbol __imp__yaml_parser_parse referenced in function ___pyx_pf_5_yaml_7CParser_14raw_parse
    _yaml.obj : error LNK2019: unresolved external symbol __imp__yaml_emitter_emit referenced in function ___pyx_pf_5_yaml_8CEmitter_6emit
    _yaml.obj : error LNK2019: unresolved external symbol __imp__yaml_stream_start_event_initialize referenced in function ___pyx_pf_5_yaml_8CEmitter_8open
    _yaml.obj : error LNK2019: unresolved external symbol __imp__yaml_stream_end_event_initialize referenced in function ___pyx_pf_5_yaml_8CEmitter_10close
    _yaml.obj : error LNK2019: unresolved external symbol __imp__yaml_mapping_end_event_initialize referenced in function ___pyx_f_5_yaml_8CEmitter__serialize_node
    _yaml.obj : error LNK2019: unresolved external symbol __imp__yaml_mapping_start_event_initialize referenced in function ___pyx_f_5_yaml_8CEmitter__serialize_node
    _yaml.obj : error LNK2019: unresolved external symbol __imp__yaml_sequence_end_event_initialize referenced in function ___pyx_f_5_yaml_8CEmitter__serialize_node
    _yaml.obj : error LNK2019: unresolved external symbol __imp__yaml_sequence_start_event_initialize referenced in function ___pyx_f_5_yaml_8CEmitter__serialize_node
    _yaml.obj : error LNK2019: unresolved external symbol __imp__yaml_scalar_event_initialize referenced in function ___pyx_f_5_yaml_8CEmitter__serialize_node
    _yaml.obj : error LNK2019: unresolved external symbol __imp__yaml_alias_event_initialize referenced in function ___pyx_f_5_yaml_8CEmitter__serialize_node
    _yaml.obj : error LNK2019: unresolved external symbol __imp__yaml_parser_set_input_string referenced in function ___pyx_pf_5_yaml_7CParser___init__
    _yaml.obj : error LNK2019: unresolved external symbol __imp__yaml_parser_set_input referenced in function ___pyx_pf_5_yaml_7CParser___init__
    _yaml.obj : error LNK2019: unresolved external symbol __imp__yaml_parser_initialize referenced in function ___pyx_pf_5_yaml_7CParser___init__
    _yaml.obj : error LNK2019: unresolved external symbol __imp__yaml_emitter_set_break referenced in function ___pyx_pf_5_yaml_8CEmitter___init__
    _yaml.obj : error LNK2019: unresolved external symbol __imp__yaml_emitter_set_unicode referenced in function ___pyx_pf_5_yaml_8CEmitter___init__
    _yaml.obj : error LNK2019: unresolved external symbol __imp__yaml_emitter_set_width referenced in function ___pyx_pf_5_yaml_8CEmitter___init__
    _yaml.obj : error LNK2019: unresolved external symbol __imp__yaml_emitter_set_indent referenced in function ___pyx_pf_5_yaml_8CEmitter___init__
    _yaml.obj : error LNK2019: unresolved external symbol __imp__yaml_emitter_set_canonical referenced in function ___pyx_pf_5_yaml_8CEmitter___init__
    _yaml.obj : error LNK2019: unresolved external symbol __imp__yaml_emitter_set_output referenced in function ___pyx_pf_5_yaml_8CEmitter___init__
    _yaml.obj : error LNK2019: unresolved external symbol __imp__yaml_emitter_initialize referenced in function ___pyx_pf_5_yaml_8CEmitter___init__
    _yaml.obj : error LNK2019: unresolved external symbol __imp__yaml_document_end_event_initialize referenced in function ___pyx_f_5_yaml_8CEmitter__object_to_event
    _yaml.obj : error LNK2019: unresolved external symbol __imp__yaml_document_start_event_initialize referenced in function ___pyx_f_5_yaml_8CEmitter__object_to_event
    build\lib.win32-2.7\_yaml.pyd : fatal error LNK1120: 29 unresolved externals
    
  3. Log in to comment