Skip to content

[macOS Binary]pyyaml installing failed on python3.7 installed by brew #522

@minggangw

Description

@minggangw

Recently homebrew has upgraded the python3 from 3.6.5 to 3.7. And when I installed the pyyaml, which is a dependency of ROS 2.0, through pip, there was an error (looks like it's incompatible with 3.7 version)

 building '_yaml' extension
  creating build/temp.macosx-10.12-x86_64-3.7/ext
  clang -Wno-unused-result -Wsign-compare -Wunreachable-code -fno-common -dynamic -DNDEBUG -g -fwrapv -O3 -Wall -I/usr/local/include -I/usr/local/opt/openssl/include -I/usr/local/opt/sqlite/include -I/usr/local/Cellar/python/3.7.0/Frameworks/Python.framework/Versions/3.7/include/python3.7m -c ext/_yaml.c -o build/temp.macosx-10.12-x86_64-3.7/ext/_yaml.o
  In file included from ext/_yaml.c:271:
  ext/_yaml.h:10:9: warning: 'PyString_CheckExact' macro redefined [-Wmacro-redefined]
  #define PyString_CheckExact PyBytes_CheckExact
          ^
  ext/_yaml.c:139:11: note: previous definition is here
    #define PyString_CheckExact          PyUnicode_CheckExact
            ^
  ext/_yaml.c:1410:17: warning: assigning to 'char *' from 'const char *' discards qualifiers [-Wincompatible-pointer-types-discards-qualifiers]
    __pyx_v_value = yaml_get_version_string();
                  ^ ~~~~~~~~~~~~~~~~~~~~~~~~~
  ext/_yaml.c:2577:52: warning: incompatible pointer types passing 'int (void *, char *, size_t, size_t *)' (aka 'int (void *, char *, unsigned long, unsigned long *)') to parameter of type 'yaml_read_handler_t *' (aka 'int (*)(void *, unsigned char *, unsigned long, unsigned long *)') [-Wincompatible-pointer-types]
      yaml_parser_set_input((&__pyx_v_self->parser), __pyx_f_5_yaml_input_handler, ((void *)__pyx_v_self));
                                                     ^~~~~~~~~~~~~~~~~~~~~~~~~~~~
  /usr/local/include/yaml.h:1368:30: note: passing argument to parameter 'handler' here
          yaml_read_handler_t *handler, void *data);
                               ^

I eliminate this error by installing the old version, which is 3.6.5

brew install https://raw.githubusercontent.com/Homebrew/homebrew-core/f2a764ef944b1080be64bd88dca9a1d80130c558/Formula/python.rb

Is it necessary to update the WiKi for the macOS platform to point out?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions