facebookresearch / fastText

Library for fast text representation and classification.
https://fasttext.cc/
MIT License
25.83k stars 4.71k forks source link

Failed to pip install in MacOS Monterey 12.3.1 for Python 3.8.9 #1272

Open ZAsprose opened 2 years ago

ZAsprose commented 2 years ago

I failed to pip install fasttext in MacOs Monterey 12.3.1 for Python 3.8.9 with the c++

opts.append(cpp_flag(self.compiler))
      File "/private/var/folders/ny/k7g_g4h949547ndhld6m1c940000gn/T/pip-install-dsxtn3ke/fasttext/setup.py", line 108, in cpp_flag
        raise RuntimeError(
    RuntimeError: Unsupported compiler -- at least C++11 support is needed!
    ----------------------------------------
ERROR: Command errored out with exit status 1: /Library/Developer/CommandLineTools/usr/bin/python3 -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/private/var/folders/ny/k7g_g4h949547ndhld6m1c940000gn/T/pip-install-dsxtn3ke/fasttext/setup.py'"'"'; __file__='"'"'/private/var/folders/ny/k7g_g4h949547ndhld6m1c940000gn/T/pip-install-dsxtn3ke/fasttext/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/ny/k7g_g4h949547ndhld6m1c940000gn/T/pip-record-pfp6ebbo/install-record.txt --single-version-externally-managed --user --prefix= --compile --install-headers /Users/zhangzhuxin/Library/Python/3.8/include/python3.8/fasttext Check the logs for full command output.
WARNING: You are using pip version 20.2.3; however, version 22.0.4 is available.
You should consider upgrading via the '/Library/Developer/CommandLineTools/usr/bin/python3 -m pip install --upgrade pip' command.

My gcc and clang version:

(base) zhangzhuxin@zhangzhuxinsMBP Desktop % gcc -v
Using built-in specs.
COLLECT_GCC=gcc-8
COLLECT_LTO_WRAPPER=/usr/local/Cellar/gcc@8/8.5.0/libexec/gcc/x86_64-apple-darwin20/8.5.0/lto-wrapper
Target: x86_64-apple-darwin20
Configured with: ../configure --prefix=/usr/local/Cellar/gcc@8/8.5.0 --libdir=/usr/local/Cellar/gcc@8/8.5.0/lib/gcc/8 --disable-nls --enable-checking=release --enable-languages=c,c++,objc,obj-c++,fortran --program-suffix=-8 --with-gmp=/usr/local/opt/gmp --with-mpfr=/usr/local/opt/mpfr --with-mpc=/usr/local/opt/libmpc --with-isl=/usr/local/opt/isl --with-pkgversion='Homebrew GCC 8.5.0' --with-bugurl=https://github.com/Homebrew/homebrew-core/issues --build=x86_64-apple-darwin20 --with-system-zlib --disable-multilib --with-native-system-header-dir=/usr/include --with-sysroot=/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk --without-build-config
Thread model: posix
gcc version 8.5.0 (Homebrew GCC 8.5.0) 
(base) zhangzhuxin@zhangzhuxinsMBP Desktop % clang -v
clang version 10.0.1 
Target: x86_64-apple-darwin21.4.0
Thread model: posix
InstalledDir: /usr/local/opt/llvm/bin

My pip verison:

(base) zhangzhuxin@zhangzhuxinsMBP Desktop % pip3 --version
pip 20.2.3 from /Library/Developer/CommandLineTools/Library/Frameworks/Python3.framework/Versions/3.8/lib/python3.8/site-packages/pip (python 3.8)