安装pip3 install hanlp报错:
Building wheels for collected packages: fasttext
Building wheel for fasttext (setup.py) … error
ERROR: Command errored out with exit status 1:
command: /usr/local/opt/python/bin/python3.6 -u -c ‘import sys, setuptools, tokenize; sys.argv[0] = ‘"’"’/private/tmp/pip-install-buiqhcep/fasttext/setup.py’"’"’; file=’"’"’/private/tmp/pip-install-buiqhcep/fasttext/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/tmp/pip-wheel-u9_fpgjn --python-tag cp36
cwd: /private/tmp/pip-install-buiqhcep/fasttext/
Complete output (33 lines):
running bdist_wheel
running build
running build_py
creating build
creating build/lib.macosx-10.13-x86_64-3.6
creating build/lib.macosx-10.13-x86_64-3.6/fasttext
copying python/fasttext_module/fasttext/init.py -> build/lib.macosx-10.13-x86_64-3.6/fasttext
copying python/fasttext_module/fasttext/FastText.py -> build/lib.macosx-10.13-x86_64-3.6/fasttext
creating build/lib.macosx-10.13-x86_64-3.6/fasttext/util
copying python/fasttext_module/fasttext/util/util.py -> build/lib.macosx-10.13-x86_64-3.6/fasttext/util
copying python/fasttext_module/fasttext/util/init.py -> build/lib.macosx-10.13-x86_64-3.6/fasttext/util
creating build/lib.macosx-10.13-x86_64-3.6/fasttext/tests
copying python/fasttext_module/fasttext/tests/test_script.py -> build/lib.macosx-10.13-x86_64-3.6/fasttext/tests
copying python/fasttext_module/fasttext/tests/init.py -> build/lib.macosx-10.13-x86_64-3.6/fasttext/tests
copying python/fasttext_module/fasttext/tests/test_configurations.py -> build/lib.macosx-10.13-x86_64-3.6/fasttext/tests
running build_ext
creating tmp
clang -Wno-unused-result -Wsign-compare -Wunreachable-code -fno-common -dynamic -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -I/usr/local/include -I/usr/local/opt/openssl/include -I/usr/local/opt/sqlite/include -I/usr/local/Cellar/python/3.6.5_1/Frameworks/Python.framework/Versions/3.6/include/python3.6m -c /tmp/tmp3wsh6kc5.cpp -o tmp/tmp3wsh6kc5.o -stdlib=libc++
clang -Wno-unused-result -Wsign-compare -Wunreachable-code -fno-common -dynamic -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -I/usr/local/include -I/usr/local/opt/openssl/include -I/usr/local/opt/sqlite/include -I/usr/local/Cellar/python/3.6.5_1/Frameworks/Python.framework/Versions/3.6/include/python3.6m -c /tmp/tmpm2z68xvv.cpp -o tmp/tmpm2z68xvv.o -std=c++14
clang -Wno-unused-result -Wsign-compare -Wunreachable-code -fno-common -dynamic -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -I/usr/local/include -I/usr/local/opt/openssl/include -I/usr/local/opt/sqlite/include -I/usr/local/Cellar/python/3.6.5_1/Frameworks/Python.framework/Versions/3.6/include/python3.6m -c /tmp/tmp2m9sktxx.cpp -o tmp/tmp2m9sktxx.o -fvisibility=hidden
building ‘fasttext_pybind’ extension
creating build/temp.macosx-10.13-x86_64-3.6
creating build/temp.macosx-10.13-x86_64-3.6/python
creating build/temp.macosx-10.13-x86_64-3.6/python/fasttext_module
creating build/temp.macosx-10.13-x86_64-3.6/python/fasttext_module/fasttext
creating build/temp.macosx-10.13-x86_64-3.6/python/fasttext_module/fasttext/pybind
creating build/temp.macosx-10.13-x86_64-3.6/src
clang -Wno-unused-result -Wsign-compare -Wunreachable-code -fno-common -dynamic -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -I/usr/local/include/python3.6m -I/Users/jerry/Library/Python/3.6/include/python3.6m -Isrc -I/usr/local/include -I/usr/local/opt/openssl/include -I/usr/local/opt/sqlite/include -I/usr/local/Cellar/python/3.6.5_1/Frameworks/Python.framework/Versions/3.6/include/python3.6m -c python/fasttext_module/fasttext/pybind/fasttext_pybind.cc -o build/temp.macosx-10.13-x86_64-3.6/python/fasttext_module/fasttext/pybind/fasttext_pybind.o -stdlib=libc++ -DVERSION_INFO=“0.9.1” -std=c++14 -fvisibility=hidden
python/fasttext_module/fasttext/pybind/fasttext_pybind.cc:12:10: fatal error: ‘pybind11/pybind11.h’ file not found
#include <pybind11/pybind11.h>
^~~~~~~~~~~~~~~~~~~~~
1 error generated.
error: command ‘clang’ failed with exit status 1
ERROR: Failed building wheel for fasttext
Running setup.py clean for fasttext
Failed to build fasttext
Installing collected packages: py-params, tqdm, params-flow, bert-for-tf2, fasttext, hanlp
Running setup.py install for fasttext … error
ERROR: Command errored out with exit status 1:
command: /usr/local/opt/python/bin/python3.6 -u -c ‘import sys, setuptools, tokenize; sys.argv[0] = ‘"’"’/private/tmp/pip-install-buiqhcep/fasttext/setup.py’"’"’; file=’"’"’/private/tmp/pip-install-buiqhcep/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/tmp/pip-record-zo4f77vf/install-record.txt --single-version-externally-managed --compile
cwd: /private/tmp/pip-install-buiqhcep/fasttext/
Complete output (32 lines):
running install
running build
running build_py
creating build
creating build/lib.macosx-10.13-x86_64-3.6
creating build/lib.macosx-10.13-x86_64-3.6/fasttext
copying python/fasttext_module/fasttext/init.py -> build/lib.macosx-10.13-x86_64-3.6/fasttext
copying python/fasttext_module/fasttext/FastText.py -> build/lib.macosx-10.13-x86_64-3.6/fasttext
creating build/lib.macosx-10.13-x86_64-3.6/fasttext/util
copying python/fasttext_module/fasttext/util/util.py -> build/lib.macosx-10.13-x86_64-3.6/fasttext/util
copying python/fasttext_module/fasttext/util/init.py -> build/lib.macosx-10.13-x86_64-3.6/fasttext/util
creating build/lib.macosx-10.13-x86_64-3.6/fasttext/tests
copying python/fasttext_module/fasttext/tests/test_script.py -> build/lib.macosx-10.13-x86_64-3.6/fasttext/tests
copying python/fasttext_module/fasttext/tests/init.py -> build/lib.macosx-10.13-x86_64-3.6/fasttext/tests
copying python/fasttext_module/fasttext/tests/test_configurations.py -> build/lib.macosx-10.13-x86_64-3.6/fasttext/tests
running build_ext
clang -Wno-unused-result -Wsign-compare -Wunreachable-code -fno-common -dynamic -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -I/usr/local/include -I/usr/local/opt/openssl/include -I/usr/local/opt/sqlite/include -I/usr/local/Cellar/python/3.6.5_1/Frameworks/Python.framework/Versions/3.6/include/python3.6m -c /tmp/tmpb6inudso.cpp -o tmp/tmpb6inudso.o -stdlib=libc++
clang -Wno-unused-result -Wsign-compare -Wunreachable-code -fno-common -dynamic -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -I/usr/local/include -I/usr/local/opt/openssl/include -I/usr/local/opt/sqlite/include -I/usr/local/Cellar/python/3.6.5_1/Frameworks/Python.framework/Versions/3.6/include/python3.6m -c /tmp/tmpfacrwml4.cpp -o tmp/tmpfacrwml4.o -std=c++14
clang -Wno-unused-result -Wsign-compare -Wunreachable-code -fno-common -dynamic -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -I/usr/local/include -I/usr/local/opt/openssl/include -I/usr/local/opt/sqlite/include -I/usr/local/Cellar/python/3.6.5_1/Frameworks/Python.framework/Versions/3.6/include/python3.6m -c /tmp/tmpeybkt9c4.cpp -o tmp/tmpeybkt9c4.o -fvisibility=hidden
building ‘fasttext_pybind’ extension
creating build/temp.macosx-10.13-x86_64-3.6
creating build/temp.macosx-10.13-x86_64-3.6/python
creating build/temp.macosx-10.13-x86_64-3.6/python/fasttext_module
creating build/temp.macosx-10.13-x86_64-3.6/python/fasttext_module/fasttext
creating build/temp.macosx-10.13-x86_64-3.6/python/fasttext_module/fasttext/pybind
creating build/temp.macosx-10.13-x86_64-3.6/src
clang -Wno-unused-result -Wsign-compare -Wunreachable-code -fno-common -dynamic -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -I/usr/local/include/python3.6m -I/Users/jerry/Library/Python/3.6/include/python3.6m -Isrc -I/usr/local/include -I/usr/local/opt/openssl/include -I/usr/local/opt/sqlite/include -I/usr/local/Cellar/python/3.6.5_1/Frameworks/Python.framework/Versions/3.6/include/python3.6m -c python/fasttext_module/fasttext/pybind/fasttext_pybind.cc -o build/temp.macosx-10.13-x86_64-3.6/python/fasttext_module/fasttext/pybind/fasttext_pybind.o -stdlib=libc++ -DVERSION_INFO=“0.9.1” -std=c++14 -fvisibility=hidden
python/fasttext_module/fasttext/pybind/fasttext_pybind.cc:12:10: fatal error: ‘pybind11/pybind11.h’ file not found
#include <pybind11/pybind11.h>
^~~~~~~~~~~~~~~~~~~~~
1 error generated.
error: command ‘clang’ failed with exit status 1
----------------------------------------
ERROR: Command errored out with exit status 1: /usr/local/opt/python/bin/python3.6 -u -c ‘import sys, setuptools, tokenize; sys.argv[0] = ‘"’"’/private/tmp/pip-install-buiqhcep/fasttext/setup.py’"’"’; file=’"’"’/private/tmp/pip-install-buiqhcep/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/tmp/pip-record-zo4f77vf/install-record.txt --single-version-externally-managed --compile Check the logs for full command output.