在 Jupyter Notebook (Anaconda) 中安装 CLTK

Installing CLTK in Jupyter Notebook (Anaconda)

我正在尝试在 Jupyter Notebook 中安装 CLTK,然后使用它来处理一些拉丁文本。 虽然尝试安装这个库,但我总是收到以下错误:

Building wheels for collected packages: fasttext, python-Levenshtein
  Building wheel for fasttext (setup.py) ... error
  ERROR: Command errored out with exit status 1:
   command: /Users/paschalis/opt/anaconda3/bin/python -u -c 'import io, os, sys, setuptools, tokenize; sys.argv[0] = '"'"'/private/var/folders/xr/qnv284y17_7__833thz7bymw0000gn/T/pip-install-xpoq70mc/fasttext_3720e21e8d4c4d75b80604497dde0fa8/setup.py'"'"'; __file__='"'"'/private/var/folders/xr/qnv284y17_7__833thz7bymw0000gn/T/pip-install-xpoq70mc/fasttext_3720e21e8d4c4d75b80604497dde0fa8/setup.py'"'"';f = getattr(tokenize, '"'"'open'"'"', open)(__file__) if os.path.exists(__file__) else io.StringIO('"'"'from setuptools import setup; setup()'"'"');code = f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' bdist_wheel -d /private/var/folders/xr/qnv284y17_7__833thz7bymw0000gn/T/pip-wheel-apa2byl_
       cwd: /private/var/folders/xr/qnv284y17_7__833thz7bymw0000gn/T/pip-install-xpoq70mc/fasttext_3720e21e8d4c4d75b80604497dde0fa8/
                    ~ ^ ~~~~~~~~~~~~~
  src/fasttext.cc:314:27: warning: comparison of integers of different signs: 'size_t' (aka 'unsigned long') and 'const int' [-Wsign-compare]
      if (i1 == eosid && i2 == eosid) { // satisfy strict weak ordering
                         ~~ ^  ~~~~~
  src/fasttext.cc:314:12: warning: comparison of integers of different signs: 'size_t' (aka 'unsigned long') and 'const int' [-Wsign-compare]
      if (i1 == eosid && i2 == eosid) { // satisfy strict weak ordering
          ~~ ^  ~~~~~
  src/fasttext.cc:317:34: warning: comparison of integers of different signs: 'const int' and 'size_t' (aka 'unsigned long') [-Wsign-compare]
      return eosid == i1 || (eosid != i2 && norms[i1] > norms[i2]);
                             ~~~~~ ^  ~~
  src/fasttext.cc:317:18: warning: comparison of integers of different signs: 'const int' and 'size_t' (aka 'unsigned long') [-Wsign-compare]
      return eosid == i1 || (eosid != i2 && norms[i1] > norms[i2]);
             ~~~~~ ^  ~~
  src/fasttext.cc:337:40: warning: comparison of integers of different signs: 'const size_t' (aka 'const unsigned long') and 'int64_t' (aka 'long long') [-Wsign-compare]
    if (qargs.cutoff > 0 && qargs.cutoff < input->size(0)) {
                            ~~~~~~~~~~~~ ^ ~~~~~~~~~~~~~~
  src/fasttext.cc:342:24: warning: comparison of integers of different signs: 'int' and 'std::vector<int>::size_type' (aka 'unsigned long') [-Wsign-compare]
      for (auto i = 0; i < idx.size(); i++) {
                       ~ ^ ~~~~~~~~~~
  src/fasttext.cc:393:25: warning: comparison of integers of different signs: 'int32_t' (aka 'int') and 'std::vector<int>::size_type' (aka 'unsigned long') [-Wsign-compare]
    for (int32_t w = 0; w < line.size(); w++) {
                        ~ ^ ~~~~~~~~~~~
  src/fasttext.cc:397:41: warning: comparison of integers of different signs: 'int' and 'std::vector<int>::size_type' (aka 'unsigned long') [-Wsign-compare]
        if (c != 0 && w + c >= 0 && w + c < line.size()) {
                                    ~~~~~ ^ ~~~~~~~~~~~
  src/fasttext.cc:411:25: warning: comparison of integers of different signs: 'int32_t' (aka 'int') and 'std::vector<int>::size_type' (aka 'unsigned long') [-Wsign-compare]
    for (int32_t w = 0; w < line.size(); w++) {
                        ~ ^ ~~~~~~~~~~~
  src/fasttext.cc:415:41: warning: comparison of integers of different signs: 'int' and 'std::vector<int>::size_type' (aka 'unsigned long') [-Wsign-compare]
        if (c != 0 && w + c >= 0 && w + c < line.size()) {
                                    ~~~~~ ^ ~~~~~~~~~~~
  src/fasttext.cc:495:27: warning: comparison of integers of different signs: 'int32_t' (aka 'int') and 'std::vector<int>::size_type' (aka 'unsigned long') [-Wsign-compare]
      for (int32_t i = 0; i < line.size(); i++) {
                          ~ ^ ~~~~~~~~~~~
  src/fasttext.cc:530:25: warning: comparison of integers of different signs: 'int32_t' (aka 'int') and 'std::vector<int>::size_type' (aka 'unsigned long') [-Wsign-compare]
    for (int32_t i = 0; i < ngrams.size(); i++) {
                        ~ ^ ~~~~~~~~~~~~~
  src/fasttext.cc:591:23: warning: comparison of integers of different signs: 'std::vector<std::pair<float, std::string>>::size_type' (aka 'unsigned long') and 'int32_t' (aka 'int') [-Wsign-compare]
        if (heap.size() == k && similarity < heap.front().first) {
            ~~~~~~~~~~~ ^  ~
  src/fasttext.cc:596:23: warning: comparison of integers of different signs: 'std::vector<std::pair<float, std::string>>::size_type' (aka 'unsigned long') and 'int32_t' (aka 'int') [-Wsign-compare]
        if (heap.size() > k) {
            ~~~~~~~~~~~ ^ ~
  src/fasttext.cc:696:24: warning: comparison of integers of different signs: 'size_t' (aka 'unsigned long') and 'int64_t' (aka 'long long') [-Wsign-compare]
    for (size_t i = 0; i < n; i++) {
                       ~ ^ ~
  src/fasttext.cc:701:26: warning: comparison of integers of different signs: 'size_t' (aka 'unsigned long') and 'int64_t' (aka 'long long') [-Wsign-compare]
      for (size_t j = 0; j < dim; j++) {
                         ~ ^ ~~~
  src/fasttext.cc:713:24: warning: comparison of integers of different signs: 'size_t' (aka 'unsigned long') and 'int64_t' (aka 'long long') [-Wsign-compare]
    for (size_t i = 0; i < n; i++) {
                       ~ ^ ~
  src/fasttext.cc:718:26: warning: comparison of integers of different signs: 'size_t' (aka 'unsigned long') and 'int64_t' (aka 'long long') [-Wsign-compare]
      for (size_t j = 0; j < dim; j++) {
                         ~ ^ ~~~
  src/fasttext.cc:803:25: warning: comparison of integers of different signs: 'int32_t' (aka 'int') and 'std::vector<std::thread>::size_type' (aka 'unsigned long') [-Wsign-compare]
    for (int32_t i = 0; i < threads.size(); i++) {
                        ~ ^ ~~~~~~~~~~~~~~
  20 warnings generated.
  x86_64-apple-darwin13.4.0-clang -fno-strict-aliasing -Wsign-compare -Wunreachable-code -DNDEBUG -fwrapv -O3 -Wall -Wstrict-prototypes -march=core2 -mtune=haswell -mssse3 -ftree-vectorize -fPIC -fPIE -fstack-protector-strong -O3 -pipe -fdebug-prefix-map=${SRC_DIR}=/usr/local/src/conda/${PKG_NAME}-${PKG_VERSION} -fdebug-prefix-map=/Users/paschalis/opt/anaconda3=/usr/local/src/conda-prefix -flto -Wl,-export_dynamic -march=core2 -mtune=haswell -mssse3 -ftree-vectorize -fPIC -fPIE -fstack-protector-strong -O3 -march=core2 -mtune=haswell -mssse3 -ftree-vectorize -fPIC -fPIE -fstack-protector-strong -O2 -pipe -isystem /Users/paschalis/opt/anaconda3/include -D_FORTIFY_SOURCE=2 -isystem /Users/paschalis/opt/anaconda3/include -I/Users/paschalis/opt/anaconda3/lib/python3.8/site-packages/pybind11/include -I/Users/paschalis/opt/anaconda3/lib/python3.8/site-packages/pybind11/include -Isrc -I/Users/paschalis/opt/anaconda3/include/python3.8 -c src/utils.cc -o build/temp.macosx-10.9-x86_64-3.8/src/utils.o -stdlib=libc++ -DVERSION_INFO="0.9.2" -std=c++14 -fvisibility=hidden
  clang-12: warning: -Wl,-export_dynamic: 'linker' input unused [-Wunused-command-line-argument]
  x86_64-apple-darwin13.4.0-clang -fno-strict-aliasing -Wsign-compare -Wunreachable-code -DNDEBUG -fwrapv -O3 -Wall -Wstrict-prototypes -march=core2 -mtune=haswell -mssse3 -ftree-vectorize -fPIC -fPIE -fstack-protector-strong -O3 -pipe -fdebug-prefix-map=${SRC_DIR}=/usr/local/src/conda/${PKG_NAME}-${PKG_VERSION} -fdebug-prefix-map=/Users/paschalis/opt/anaconda3=/usr/local/src/conda-prefix -flto -Wl,-export_dynamic -march=core2 -mtune=haswell -mssse3 -ftree-vectorize -fPIC -fPIE -fstack-protector-strong -O3 -march=core2 -mtune=haswell -mssse3 -ftree-vectorize -fPIC -fPIE -fstack-protector-strong -O2 -pipe -isystem /Users/paschalis/opt/anaconda3/include -D_FORTIFY_SOURCE=2 -isystem /Users/paschalis/opt/anaconda3/include -I/Users/paschalis/opt/anaconda3/lib/python3.8/site-packages/pybind11/include -I/Users/paschalis/opt/anaconda3/lib/python3.8/site-packages/pybind11/include -Isrc -I/Users/paschalis/opt/anaconda3/include/python3.8 -c src/model.cc -o build/temp.macosx-10.9-x86_64-3.8/src/model.o -stdlib=libc++ -DVERSION_INFO="0.9.2" -std=c++14 -fvisibility=hidden
  clang-12: warning: -Wl,-export_dynamic: 'linker' input unused [-Wunused-command-line-argument]
  x86_64-apple-darwin13.4.0-clang -fno-strict-aliasing -Wsign-compare -Wunreachable-code -DNDEBUG -fwrapv -O3 -Wall -Wstrict-prototypes -march=core2 -mtune=haswell -mssse3 -ftree-vectorize -fPIC -fPIE -fstack-protector-strong -O3 -pipe -fdebug-prefix-map=${SRC_DIR}=/usr/local/src/conda/${PKG_NAME}-${PKG_VERSION} -fdebug-prefix-map=/Users/paschalis/opt/anaconda3=/usr/local/src/conda-prefix -flto -Wl,-export_dynamic -march=core2 -mtune=haswell -mssse3 -ftree-vectorize -fPIC -fPIE -fstack-protector-strong -O3 -march=core2 -mtune=haswell -mssse3 -ftree-vectorize -fPIC -fPIE -fstack-protector-strong -O2 -pipe -isystem /Users/paschalis/opt/anaconda3/include -D_FORTIFY_SOURCE=2 -isystem /Users/paschalis/opt/anaconda3/include -I/Users/paschalis/opt/anaconda3/lib/python3.8/site-packages/pybind11/include -I/Users/paschalis/opt/anaconda3/lib/python3.8/site-packages/pybind11/include -Isrc -I/Users/paschalis/opt/anaconda3/include/python3.8 -c src/loss.cc -o build/temp.macosx-10.9-x86_64-3.8/src/loss.o -stdlib=libc++ -DVERSION_INFO="0.9.2" -std=c++14 -fvisibility=hidden
  clang-12: warning: -Wl,-export_dynamic: 'linker' input unused [-Wunused-command-line-argument]
  src/loss.cc:83:21: warning: comparison of integers of different signs: 'std::vector<std::pair<float, int>>::size_type' (aka 'unsigned long') and 'int32_t' (aka 'int') [-Wsign-compare]
      if (heap.size() == k && std_log(output[i]) < heap.front().first) {
          ~~~~~~~~~~~ ^  ~
  src/loss.cc:88:21: warning: comparison of integers of different signs: 'std::vector<std::pair<float, int>>::size_type' (aka 'unsigned long') and 'int32_t' (aka 'int') [-Wsign-compare]
      if (heap.size() > k) {
          ~~~~~~~~~~~ ^ ~
  src/loss.cc:257:25: warning: comparison of integers of different signs: 'int32_t' (aka 'int') and 'std::vector<int>::size_type' (aka 'unsigned long') [-Wsign-compare]
    for (int32_t i = 0; i < pathToRoot.size(); i++) {
                        ~ ^ ~~~~~~~~~~~~~~~~~
  src/loss.cc:282:19: warning: comparison of integers of different signs: 'std::vector<std::pair<float, int>>::size_type' (aka 'unsigned long') and 'int32_t' (aka 'int') [-Wsign-compare]
    if (heap.size() == k && score < heap.front().first) {
        ~~~~~~~~~~~ ^  ~
  src/loss.cc:289:21: warning: comparison of integers of different signs: 'std::vector<std::pair<float, int>>::size_type' (aka 'unsigned long') and 'int32_t' (aka 'int') [-Wsign-compare]
      if (heap.size() > k) {
          ~~~~~~~~~~~ ^ ~
  5 warnings generated.
  x86_64-apple-darwin13.4.0-clang -fno-strict-aliasing -Wsign-compare -Wunreachable-code -DNDEBUG -fwrapv -O3 -Wall -Wstrict-prototypes -march=core2 -mtune=haswell -mssse3 -ftree-vectorize -fPIC -fPIE -fstack-protector-strong -O3 -pipe -fdebug-prefix-map=${SRC_DIR}=/usr/local/src/conda/${PKG_NAME}-${PKG_VERSION} -fdebug-prefix-map=/Users/paschalis/opt/anaconda3=/usr/local/src/conda-prefix -flto -Wl,-export_dynamic -march=core2 -mtune=haswell -mssse3 -ftree-vectorize -fPIC -fPIE -fstack-protector-strong -O3 -march=core2 -mtune=haswell -mssse3 -ftree-vectorize -fPIC -fPIE -fstack-protector-strong -O2 -pipe -isystem /Users/paschalis/opt/anaconda3/include -D_FORTIFY_SOURCE=2 -isystem /Users/paschalis/opt/anaconda3/include -I/Users/paschalis/opt/anaconda3/lib/python3.8/site-packages/pybind11/include -I/Users/paschalis/opt/anaconda3/lib/python3.8/site-packages/pybind11/include -Isrc -I/Users/paschalis/opt/anaconda3/include/python3.8 -c src/productquantizer.cc -o build/temp.macosx-10.9-x86_64-3.8/src/productquantizer.o -stdlib=libc++ -DVERSION_INFO="0.9.2" -std=c++14 -fvisibility=hidden
  clang-12: warning: -Wl,-export_dynamic: 'linker' input unused [-Wunused-command-line-argument]
  src/productquantizer.cc:246:22: warning: comparison of integers of different signs: 'int' and 'std::vector<float>::size_type' (aka 'unsigned long') [-Wsign-compare]
    for (auto i = 0; i < centroids_.size(); i++) {
                     ~ ^ ~~~~~~~~~~~~~~~~~
  1 warning generated.
  x86_64-apple-darwin13.4.0-clang -fno-strict-aliasing -Wsign-compare -Wunreachable-code -DNDEBUG -fwrapv -O3 -Wall -Wstrict-prototypes -march=core2 -mtune=haswell -mssse3 -ftree-vectorize -fPIC -fPIE -fstack-protector-strong -O3 -pipe -fdebug-prefix-map=${SRC_DIR}=/usr/local/src/conda/${PKG_NAME}-${PKG_VERSION} -fdebug-prefix-map=/Users/paschalis/opt/anaconda3=/usr/local/src/conda-prefix -flto -Wl,-export_dynamic -march=core2 -mtune=haswell -mssse3 -ftree-vectorize -fPIC -fPIE -fstack-protector-strong -O3 -march=core2 -mtune=haswell -mssse3 -ftree-vectorize -fPIC -fPIE -fstack-protector-strong -O2 -pipe -isystem /Users/paschalis/opt/anaconda3/include -D_FORTIFY_SOURCE=2 -isystem /Users/paschalis/opt/anaconda3/include -I/Users/paschalis/opt/anaconda3/lib/python3.8/site-packages/pybind11/include -I/Users/paschalis/opt/anaconda3/lib/python3.8/site-packages/pybind11/include -Isrc -I/Users/paschalis/opt/anaconda3/include/python3.8 -c src/args.cc -o build/temp.macosx-10.9-x86_64-3.8/src/args.o -stdlib=libc++ -DVERSION_INFO="0.9.2" -std=c++14 -fvisibility=hidden
  clang-12: warning: -Wl,-export_dynamic: 'linker' input unused [-Wunused-command-line-argument]
  src/args.cc:120:23: warning: comparison of integers of different signs: 'int' and 'std::vector<std::string>::size_type' (aka 'unsigned long') [-Wsign-compare]
    for (int ai = 2; ai < args.size(); ai += 2) {
                     ~~ ^ ~~~~~~~~~~~
  1 warning generated.
  x86_64-apple-darwin13.4.0-clang -fno-strict-aliasing -Wsign-compare -Wunreachable-code -DNDEBUG -fwrapv -O3 -Wall -Wstrict-prototypes -march=core2 -mtune=haswell -mssse3 -ftree-vectorize -fPIC -fPIE -fstack-protector-strong -O3 -pipe -fdebug-prefix-map=${SRC_DIR}=/usr/local/src/conda/${PKG_NAME}-${PKG_VERSION} -fdebug-prefix-map=/Users/paschalis/opt/anaconda3=/usr/local/src/conda-prefix -flto -Wl,-export_dynamic -march=core2 -mtune=haswell -mssse3 -ftree-vectorize -fPIC -fPIE -fstack-protector-strong -O3 -march=core2 -mtune=haswell -mssse3 -ftree-vectorize -fPIC -fPIE -fstack-protector-strong -O2 -pipe -isystem /Users/paschalis/opt/anaconda3/include -D_FORTIFY_SOURCE=2 -isystem /Users/paschalis/opt/anaconda3/include -I/Users/paschalis/opt/anaconda3/lib/python3.8/site-packages/pybind11/include -I/Users/paschalis/opt/anaconda3/lib/python3.8/site-packages/pybind11/include -Isrc -I/Users/paschalis/opt/anaconda3/include/python3.8 -c src/quantmatrix.cc -o build/temp.macosx-10.9-x86_64-3.8/src/quantmatrix.o -stdlib=libc++ -DVERSION_INFO="0.9.2" -std=c++14 -fvisibility=hidden
  clang-12: warning: -Wl,-export_dynamic: 'linker' input unused [-Wunused-command-line-argument]
  x86_64-apple-darwin13.4.0-clang -fno-strict-aliasing -Wsign-compare -Wunreachable-code -DNDEBUG -fwrapv -O3 -Wall -Wstrict-prototypes -march=core2 -mtune=haswell -mssse3 -ftree-vectorize -fPIC -fPIE -fstack-protector-strong -O3 -pipe -fdebug-prefix-map=${SRC_DIR}=/usr/local/src/conda/${PKG_NAME}-${PKG_VERSION} -fdebug-prefix-map=/Users/paschalis/opt/anaconda3=/usr/local/src/conda-prefix -flto -Wl,-export_dynamic -march=core2 -mtune=haswell -mssse3 -ftree-vectorize -fPIC -fPIE -fstack-protector-strong -O3 -march=core2 -mtune=haswell -mssse3 -ftree-vectorize -fPIC -fPIE -fstack-protector-strong -O2 -pipe -isystem /Users/paschalis/opt/anaconda3/include -D_FORTIFY_SOURCE=2 -isystem /Users/paschalis/opt/anaconda3/include -I/Users/paschalis/opt/anaconda3/lib/python3.8/site-packages/pybind11/include -I/Users/paschalis/opt/anaconda3/lib/python3.8/site-packages/pybind11/include -Isrc -I/Users/paschalis/opt/anaconda3/include/python3.8 -c src/matrix.cc -o build/temp.macosx-10.9-x86_64-3.8/src/matrix.o -stdlib=libc++ -DVERSION_INFO="0.9.2" -std=c++14 -fvisibility=hidden
  clang-12: warning: -Wl,-export_dynamic: 'linker' input unused [-Wunused-command-line-argument]
  x86_64-apple-darwin13.4.0-clang -fno-strict-aliasing -Wsign-compare -Wunreachable-code -DNDEBUG -fwrapv -O3 -Wall -Wstrict-prototypes -march=core2 -mtune=haswell -mssse3 -ftree-vectorize -fPIC -fPIE -fstack-protector-strong -O3 -pipe -fdebug-prefix-map=${SRC_DIR}=/usr/local/src/conda/${PKG_NAME}-${PKG_VERSION} -fdebug-prefix-map=/Users/paschalis/opt/anaconda3=/usr/local/src/conda-prefix -flto -Wl,-export_dynamic -march=core2 -mtune=haswell -mssse3 -ftree-vectorize -fPIC -fPIE -fstack-protector-strong -O3 -march=core2 -mtune=haswell -mssse3 -ftree-vectorize -fPIC -fPIE -fstack-protector-strong -O2 -pipe -isystem /Users/paschalis/opt/anaconda3/include -D_FORTIFY_SOURCE=2 -isystem /Users/paschalis/opt/anaconda3/include -I/Users/paschalis/opt/anaconda3/lib/python3.8/site-packages/pybind11/include -I/Users/paschalis/opt/anaconda3/lib/python3.8/site-packages/pybind11/include -Isrc -I/Users/paschalis/opt/anaconda3/include/python3.8 -c src/meter.cc -o build/temp.macosx-10.9-x86_64-3.8/src/meter.o -stdlib=libc++ -DVERSION_INFO="0.9.2" -std=c++14 -fvisibility=hidden
  clang-12: warning: -Wl,-export_dynamic: 'linker' input unused [-Wunused-command-line-argument]
  x86_64-apple-darwin13.4.0-clang -fno-strict-aliasing -Wsign-compare -Wunreachable-code -DNDEBUG -fwrapv -O3 -Wall -Wstrict-prototypes -march=core2 -mtune=haswell -mssse3 -ftree-vectorize -fPIC -fPIE -fstack-protector-strong -O3 -pipe -fdebug-prefix-map=${SRC_DIR}=/usr/local/src/conda/${PKG_NAME}-${PKG_VERSION} -fdebug-prefix-map=/Users/paschalis/opt/anaconda3=/usr/local/src/conda-prefix -flto -Wl,-export_dynamic -march=core2 -mtune=haswell -mssse3 -ftree-vectorize -fPIC -fPIE -fstack-protector-strong -O3 -march=core2 -mtune=haswell -mssse3 -ftree-vectorize -fPIC -fPIE -fstack-protector-strong -O2 -pipe -isystem /Users/paschalis/opt/anaconda3/include -D_FORTIFY_SOURCE=2 -isystem /Users/paschalis/opt/anaconda3/include -I/Users/paschalis/opt/anaconda3/lib/python3.8/site-packages/pybind11/include -I/Users/paschalis/opt/anaconda3/lib/python3.8/site-packages/pybind11/include -Isrc -I/Users/paschalis/opt/anaconda3/include/python3.8 -c src/vector.cc -o build/temp.macosx-10.9-x86_64-3.8/src/vector.o -stdlib=libc++ -DVERSION_INFO="0.9.2" -std=c++14 -fvisibility=hidden
  clang-12: warning: -Wl,-export_dynamic: 'linker' input unused [-Wunused-command-line-argument]
  x86_64-apple-darwin13.4.0-clang -fno-strict-aliasing -Wsign-compare -Wunreachable-code -DNDEBUG -fwrapv -O3 -Wall -Wstrict-prototypes -march=core2 -mtune=haswell -mssse3 -ftree-vectorize -fPIC -fPIE -fstack-protector-strong -O3 -pipe -fdebug-prefix-map=${SRC_DIR}=/usr/local/src/conda/${PKG_NAME}-${PKG_VERSION} -fdebug-prefix-map=/Users/paschalis/opt/anaconda3=/usr/local/src/conda-prefix -flto -Wl,-export_dynamic -march=core2 -mtune=haswell -mssse3 -ftree-vectorize -fPIC -fPIE -fstack-protector-strong -O3 -march=core2 -mtune=haswell -mssse3 -ftree-vectorize -fPIC -fPIE -fstack-protector-strong -O2 -pipe -isystem /Users/paschalis/opt/anaconda3/include -D_FORTIFY_SOURCE=2 -isystem /Users/paschalis/opt/anaconda3/include -I/Users/paschalis/opt/anaconda3/lib/python3.8/site-packages/pybind11/include -I/Users/paschalis/opt/anaconda3/lib/python3.8/site-packages/pybind11/include -Isrc -I/Users/paschalis/opt/anaconda3/include/python3.8 -c src/densematrix.cc -o build/temp.macosx-10.9-x86_64-3.8/src/densematrix.o -stdlib=libc++ -DVERSION_INFO="0.9.2" -std=c++14 -fvisibility=hidden
  clang-12: warning: -Wl,-export_dynamic: 'linker' input unused [-Wunused-command-line-argument]
  src/densematrix.cc:48:23: warning: comparison of integers of different signs: 'int' and 'unsigned int' [-Wsign-compare]
      for (int i = 0; i < thread; i++) {
                      ~ ^ ~~~~~~
  src/densematrix.cc:51:27: warning: comparison of integers of different signs: 'int32_t' (aka 'int') and 'std::vector<std::thread>::size_type' (aka 'unsigned long') [-Wsign-compare]
      for (int32_t i = 0; i < threads.size(); i++) {
                          ~ ^ ~~~~~~~~~~~~~~
  2 warnings generated.
  x86_64-apple-darwin13.4.0-clang++ -bundle -undefined dynamic_lookup -Wl,-pie -Wl,-headerpad_max_install_names -Wl,-dead_strip_dylibs -Wl,-rpath,/Users/paschalis/opt/anaconda3/lib -L/Users/paschalis/opt/anaconda3/lib -flto -Wl,-export_dynamic -Wl,-pie -Wl,-headerpad_max_install_names -Wl,-dead_strip_dylibs -Wl,-rpath,/Users/paschalis/opt/anaconda3/lib -L/Users/paschalis/opt/anaconda3/lib -Wl,-pie -Wl,-headerpad_max_install_names -Wl,-dead_strip_dylibs -Wl,-rpath,/Users/paschalis/opt/anaconda3/lib -L/Users/paschalis/opt/anaconda3/lib -march=core2 -mtune=haswell -mssse3 -ftree-vectorize -fPIC -fPIE -fstack-protector-strong -O2 -pipe -isystem /Users/paschalis/opt/anaconda3/include -D_FORTIFY_SOURCE=2 -isystem /Users/paschalis/opt/anaconda3/include -arch x86_64 build/temp.macosx-10.9-x86_64-3.8/python/fasttext_module/fasttext/pybind/fasttext_pybind.o build/temp.macosx-10.9-x86_64-3.8/src/dictionary.o build/temp.macosx-10.9-x86_64-3.8/src/main.o build/temp.macosx-10.9-x86_64-3.8/src/autotune.o build/temp.macosx-10.9-x86_64-3.8/src/fasttext.o build/temp.macosx-10.9-x86_64-3.8/src/utils.o build/temp.macosx-10.9-x86_64-3.8/src/model.o build/temp.macosx-10.9-x86_64-3.8/src/loss.o build/temp.macosx-10.9-x86_64-3.8/src/productquantizer.o build/temp.macosx-10.9-x86_64-3.8/src/args.o build/temp.macosx-10.9-x86_64-3.8/src/quantmatrix.o build/temp.macosx-10.9-x86_64-3.8/src/matrix.o build/temp.macosx-10.9-x86_64-3.8/src/meter.o build/temp.macosx-10.9-x86_64-3.8/src/vector.o build/temp.macosx-10.9-x86_64-3.8/src/densematrix.o -o build/lib.macosx-10.9-x86_64-3.8/fasttext_pybind.cpython-38-darwin.so
  ld: warning: -pie being ignored. It is only used when linking a main executable
  ld: unsupported tapi file type '!tapi-tbd' in YAML file '/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/lib/libSystem.tbd' for architecture x86_64
  clang-12: error: linker command failed with exit code 1 (use -v to see invocation)
  error: command 'x86_64-apple-darwin13.4.0-clang++' failed with exit status 1
  ----------------------------------------
  ERROR: Failed building wheel for fasttext
  Running setup.py clean for fasttext
  Building wheel for python-Levenshtein (setup.py) ... error
  ERROR: Command errored out with exit status 1:
   command: /Users/paschalis/opt/anaconda3/bin/python -u -c 'import io, os, sys, setuptools, tokenize; sys.argv[0] = '"'"'/private/var/folders/xr/qnv284y17_7__833thz7bymw0000gn/T/pip-install-xpoq70mc/python-levenshtein_4666f8084b754cd0864f1418f860bdc4/setup.py'"'"'; __file__='"'"'/private/var/folders/xr/qnv284y17_7__833thz7bymw0000gn/T/pip-install-xpoq70mc/python-levenshtein_4666f8084b754cd0864f1418f860bdc4/setup.py'"'"';f = getattr(tokenize, '"'"'open'"'"', open)(__file__) if os.path.exists(__file__) else io.StringIO('"'"'from setuptools import setup; setup()'"'"');code = f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' bdist_wheel -d /private/var/folders/xr/qnv284y17_7__833thz7bymw0000gn/T/pip-wheel-iyv1b14u
       cwd: /private/var/folders/xr/qnv284y17_7__833thz7bymw0000gn/T/pip-install-xpoq70mc/python-levenshtein_4666f8084b754cd0864f1418f860bdc4/

  ERROR: Failed building wheel for python-Levenshtein

    Running setup.py install for python-Levenshtein ... error
    ERROR: Command errored out with exit status 1:
     command: /Users/paschalis/opt/anaconda3/bin/python -u -c 'import io, os, sys, setuptools, tokenize; sys.argv[0] = '"'"'/private/var/folders/xr/qnv284y17_7__833thz7bymw0000gn/T/pip-install-xpoq70mc/python-levenshtein_4666f8084b754cd0864f1418f860bdc4/setup.py'"'"'; __file__='"'"'/private/var/folders/xr/qnv284y17_7__833thz7bymw0000gn/T/pip-install-xpoq70mc/python-levenshtein_4666f8084b754cd0864f1418f860bdc4/setup.py'"'"';f = getattr(tokenize, '"'"'open'"'"', open)(__file__) if os.path.exists(__file__) else io.StringIO('"'"'from setuptools import setup; setup()'"'"');code = f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' install --record /private/var/folders/xr/qnv284y17_7__833thz7bymw0000gn/T/pip-record-4vren9br/install-record.txt --single-version-externally-managed --compile --install-headers /Users/paschalis/opt/anaconda3/include/python3.8/python-Levenshtein
         cwd: /private/var/folders/xr/qnv284y17_7__833thz7bymw0000gn/T/pip-install-xpoq70mc/python-levenshtein_4666f8084b754cd0864f1418f860bdc4/
    Complete output (147 lines):
    /Users/paschalis/opt/anaconda3/lib/python3.8/site-packages/setuptools/config/__init__.py:28: SetuptoolsDeprecationWarning: As setuptools moves its configuration towards `pyproject.toml`,
    `setuptools.config.parse_configuration` became deprecated.

ERROR: Command errored out with exit status 1: /Users/paschalis/opt/anaconda3/bin/python -u -c 'import io, os, sys, setuptools, tokenize; sys.argv[0] = '"'"'/private/var/folders/xr/qnv284y17_7__833thz7bymw0000gn/T/pip-install-xpoq70mc/python-levenshtein_4666f8084b754cd0864f1418f860bdc4/setup.py'"'"'; __file__='"'"'/private/var/folders/xr/qnv284y17_7__833thz7bymw0000gn/T/pip-install-xpoq70mc/python-levenshtein_4666f8084b754cd0864f1418f860bdc4/setup.py'"'"';f = getattr(tokenize, '"'"'open'"'"', open)(__file__) if os.path.exists(__file__) else io.StringIO('"'"'from setuptools import setup; setup()'"'"');code = f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' install --record /private/var/folders/xr/qnv284y17_7__833thz7bymw0000gn/T/pip-record-4vren9br/install-record.txt --single-version-externally-managed --compile --install-headers /Users/paschalis/opt/anaconda3/include/python3.8/python-Levenshtein Check the logs for full command output.

对于安装,我使用了以下两个命令:

!pip install cltk

和:

!{sys.executable} -m pip install cltk

并且都返回相同的错误。

预先感谢您的帮助!

我没有 Mac 并且不太熟悉如何正确设置内置系统。

由于无法构建 fasttextpython-levenstein,我建议您尝试使用 conda 来满足这些依赖项。此外,建议不要在 anaconda 的基本环境中执行此操作。 SO 上有无数这样的例子,在某些时候搞乱基本环境最终会导致无法使用的状态。

所以,创建一个新的环境:

conda create -n cltkEnv -c conda-forge fasttext python-Levenshtein

然后激活它并尝试从 pypi 安装 cltk:

conda activate cltkEnv
pip install cltk