Install spacy in macOS 10.15

 

pip install failure

I meet a build problem when pip install spacy-cld to detect language. The error seems like that:

    /private/var/folders/t_/r4gqwlxn7ps1jzh95nxgs7bc0000gn/T/pip-install-sdlh62lw/pycld2/cld2/internal/utf8statetable.h:25:10: fatal error: 'string' file not found
    #include <string>
             ^~~~~~~~
    1 error generated.
    error: command 'gcc' failed with exit status 1

I guess this is a problem of build problem in macOS, usually caused by gcc with different versions in macOS.

The solution is :

CFLAGS=-stdlib=libc++ pip install spacy_cld