vrasneur/pyfasttext

Mac OS installation error for 0.4.0: Command 'gcc' failed with exit status 1

Closed this issue · 2 comments

$ pip install -U pyfasttext

Collecting pyfasttext
  Downloading pyfasttext-0.4.0.tar.gz (213kB)
    100% |████████████████████████████████| 215kB 274kB/s 
Requirement already up-to-date: cysignals in ./anaconda/lib/python2.7/site-packages (from pyfasttext)
Requirement already up-to-date: future in ./anaconda/lib/python2.7/site-packages (from pyfasttext)
Requirement already up-to-date: numpy in ./anaconda/lib/python2.7/site-packages (from pyfasttext)
Installing collected packages: pyfasttext
  Found existing installation: pyfasttext 0.3.0
    Uninstalling pyfasttext-0.3.0:
      Successfully uninstalled pyfasttext-0.3.0
  Running setup.py install for pyfasttext ... error
    Complete output from command /Users/Snehal/anaconda/bin/python -u -c "import setuptools, tokenize;__file__='/private/tmp/pip-build-SRkx4W/pyfasttext/setup.py';f=getattr(tokenize, 'open', open)(__file__);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, __file__, 'exec'))" install --record /tmp/pip-eQxluA-record/install-record.txt --single-version-externally-managed --compile:
    running install
    running build
    running build_ext
    building 'pyfasttext' extension
    creating build
    creating build/temp.macosx-10.7-x86_64-2.7
    creating build/temp.macosx-10.7-x86_64-2.7/src
    creating build/temp.macosx-10.7-x86_64-2.7/src/fastText
    creating build/temp.macosx-10.7-x86_64-2.7/src/fastText/src
    gcc -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -iquote . -include src/custom_exit.h -I/Users/Snehal/anaconda/lib/python2.7/site-packages/cysignals -I. -Isrc/variant/include -I/Users/Snehal/anaconda/lib/python2.7/site-packages/numpy/core/include -I/Users/Snehal/anaconda/include/python2.7 -c src/pyfasttext.cpp -o build/temp.macosx-10.7-x86_64-2.7/src/pyfasttext.o -std=c++0x -Wno-sign-compare
    cc1plus: warning: command line option '-Wstrict-prototypes' is valid for C/ObjC but not for C++
    In file included from ./src/custom_exit.h:5:0,
                     from <command-line>:0:
    /opt/local/include/gcc7/c++/cstdlib:75:15: fatal error: stdlib.h: No such file or directory
     #include_next <stdlib.h>
                   ^~~~~~~~~~
    compilation terminated.
    error: command 'gcc' failed with exit status 1
    
    ----------------------------------------
  Rolling back uninstall of pyfasttext
Command "/Users/Snehal/anaconda/bin/python -u -c "import setuptools, tokenize;__file__='/private/tmp/pip-build-SRkx4W/pyfasttext/setup.py';f=getattr(tokenize, 'open', open)(__file__);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, __file__, 'exec'))" install --record /tmp/pip-eQxluA-record/install-record.txt --single-version-externally-managed --compile" failed with error code 1 in /private/tmp/pip-build-SRkx4W/pyfasttext/

Have you installed the XCode command line tools?

To install them, you must execute xcode-select --install

Aha.. Looks like with new MacOS High Sierra you need to re-install XCode command line tools.. again! This solves the issue. Thank You!