ovalhub/pyicu

Issue installing on Mac Os Mojave 10.14.2

jerryatt opened this issue · 8 comments

While using pip install pyicu, facing the error posted below

Command "/anaconda3/bin/python -u -c "import setuptools, tokenize;file='/private/var/folders/5c/nbpp5fhj3735nc1mht267c6h0000gn/T/pip-install-4j6_0t28/PyICU/setup.py';f=getattr(tokenize, 'open', open)(file);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, file, 'exec'))" install --record /private/var/folders/5c/nbpp5fhj3735nc1mht267c6h0000gn/T/pip-record-l8y0wnuj/install-record.txt --single-version-externally-managed --compile" failed with error code 1 in /private/var/folders/5c/nbpp5fhj3735nc1mht267c6h0000gn/T/pip-install-4j6_0t28/PyICU/

Got the same error on Mac Os Mojave 10.14.6. I appreciate the help I can get. The error report I got was:

  Using cached https://files.pythonhosted.org/packages/e9/35/211ffb949c68e688ade7d40426de030a24eaec4b6c45330eeb9c0285f43a/PyICU-2.3.1.tar.gz
Building wheels for collected packages: PyICU
  Building wheel for PyICU (setup.py) ... error
  ERROR: Complete output from command //anaconda3/bin/python -u -c 'import setuptools, tokenize;__file__='"'"'/private/var/folders/n0/dbr4csn14f3fp96kvnlbn9540000gn/T/pip-install-v9grg62s/PyICU/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' bdist_wheel -d /private/var/folders/n0/dbr4csn14f3fp96kvnlbn9540000gn/T/pip-wheel-5ixpe536 --python-tag cp37:
  ERROR: (running 'icu-config --version')

  Building PyICU 2.3.1 for ICU 58.2

  (running 'icu-config --cxxflags --cppflags')
  Adding CFLAGS="-I//anaconda3/include" from //anaconda3/bin/icu-config
  (running 'icu-config --ldflags')
  Adding LFLAGS="-Wl,-rpath,//anaconda3/lib -L//anaconda3/lib -licui18n -licuuc -licudata" from //anaconda3/bin/icu-config
  running bdist_wheel
  running build
  running build_py
  creating build
  creating build/lib.macosx-10.7-x86_64-3.7
  copying PyICU.py -> build/lib.macosx-10.7-x86_64-3.7
  creating build/lib.macosx-10.7-x86_64-3.7/icu
  copying icu/__init__.py -> build/lib.macosx-10.7-x86_64-3.7/icu
  running build_ext
  building '_icu' extension
  creating build/temp.macosx-10.7-x86_64-3.7
  gcc -Wno-unused-result -Wsign-compare -Wunreachable-code -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -I//anaconda3/include -arch x86_64 -I//anaconda3/include -arch x86_64 -I//anaconda3/include/python3.7m -c _icu.cpp -o build/temp.macosx-10.7-x86_64-3.7/_icu.o -I//anaconda3/include -DPYICU_VER="2.3.1"
  warning: include path for stdlibc++ headers not found; pass '-stdlib=libc++' on the command line to use the libc++ standard library instead [-Wstdlibcxx-not-found]
  In file included from _icu.cpp:27:
  ./common.h:38:13: error: unknown type name 'decltype'
      typedef decltype(nullptr) nullptr_t;
              ^
  ./common.h:38:30: error: expected ';' after top level declarator
      typedef decltype(nullptr) nullptr_t;
                               ^
                               ;
  In file included from _icu.cpp:27:
  In file included from ./common.h:106:
  In file included from //anaconda3/include/unicode/unistr.h:33:
  //anaconda3/include/unicode/std_string.h:35:10: fatal error: 'string' file not found
  #include <string>
           ^~~~~~~~
  1 warning and 3 errors generated.
  error: command 'gcc' failed with exit status 1
  ----------------------------------------
  ERROR: Failed building wheel for PyICU
  Running setup.py clean for PyICU
Failed to build PyICU
Installing collected packages: PyICU
  Running setup.py install for PyICU ... error
    ERROR: Complete output from command //anaconda3/bin/python -u -c 'import setuptools, tokenize;__file__='"'"'/private/var/folders/n0/dbr4csn14f3fp96kvnlbn9540000gn/T/pip-install-v9grg62s/PyICU/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' install --record /private/var/folders/n0/dbr4csn14f3fp96kvnlbn9540000gn/T/pip-record-sckofv0e/install-record.txt --single-version-externally-managed --compile:
    ERROR: (running 'icu-config --version')

    Building PyICU 2.3.1 for ICU 58.2

    (running 'icu-config --cxxflags --cppflags')
    Adding CFLAGS="-I//anaconda3/include" from //anaconda3/bin/icu-config
    (running 'icu-config --ldflags')
    Adding LFLAGS="-Wl,-rpath,//anaconda3/lib -L//anaconda3/lib -licui18n -licuuc -licudata" from //anaconda3/bin/icu-config
    running install
    running build
    running build_py
    creating build
    creating build/lib.macosx-10.7-x86_64-3.7
    copying PyICU.py -> build/lib.macosx-10.7-x86_64-3.7
    creating build/lib.macosx-10.7-x86_64-3.7/icu
    copying icu/__init__.py -> build/lib.macosx-10.7-x86_64-3.7/icu
    running build_ext
    building '_icu' extension
    creating build/temp.macosx-10.7-x86_64-3.7
    gcc -Wno-unused-result -Wsign-compare -Wunreachable-code -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -I//anaconda3/include -arch x86_64 -I//anaconda3/include -arch x86_64 -I//anaconda3/include/python3.7m -c _icu.cpp -o build/temp.macosx-10.7-x86_64-3.7/_icu.o -I//anaconda3/include -DPYICU_VER="2.3.1"
    warning: include path for stdlibc++ headers not found; pass '-stdlib=libc++' on the command line to use the libc++ standard library instead [-Wstdlibcxx-not-found]
    In file included from _icu.cpp:27:
    ./common.h:38:13: error: unknown type name 'decltype'
        typedef decltype(nullptr) nullptr_t;
                ^
    ./common.h:38:30: error: expected ';' after top level declarator
        typedef decltype(nullptr) nullptr_t;
                                 ^
                                 ;
    In file included from _icu.cpp:27:
    In file included from ./common.h:106:
    In file included from //anaconda3/include/unicode/unistr.h:33:
    //anaconda3/include/unicode/std_string.h:35:10: fatal error: 'string' file not found
    #include <string>
             ^~~~~~~~
    1 warning and 3 errors generated.
    error: command 'gcc' failed with exit status 1
    ----------------------------------------
ERROR: Command "//anaconda3/bin/python -u -c 'import setuptools, tokenize;__file__='"'"'/private/var/folders/n0/dbr4csn14f3fp96kvnlbn9540000gn/T/pip-install-v9grg62s/PyICU/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' install --record /private/var/folders/n0/dbr4csn14f3fp96kvnlbn9540000gn/T/pip-record-sckofv0e/install-record.txt --single-version-externally-managed --compile" failed with error code 1 in /private/var/folders/n0/dbr4csn14f3fp96kvnlbn9540000gn/T/pip-install-v9grg62s/PyICU/```

no activity

I have the same installation issue after having installed ICU with brew brew install icu4c

yes exactly

It appears that this message "pass '-stdlib=libc++' on the command line to use the libc++ standard library instead" could be part of the errors reported and give a hint as to how to solve this issue.