报错如下:
ERROR: Command errored out with exit status 1:
command: /Users/yzchen/anaconda3/bin/python -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/private/var/folders/_w/_62wz17d3zq1lwsv8cbrgrpm0000gn/T/pip-install-n2_smac6/tesserocr/setup.py'"'"'; __file__='"'"'/private/var/folders/_w/_62wz17d3zq1lwsv8cbrgrpm0000gn/T/pip-install-n2_smac6/tesserocr/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/_w/_62wz17d3zq1lwsv8cbrgrpm0000gn/T/pip-wheel-l6157p99 --python-tag cp37
cwd: /private/var/folders/_w/_62wz17d3zq1lwsv8cbrgrpm0000gn/T/pip-install-n2_smac6/tesserocr/
Complete output (15 lines):
Supporting tesseract v4.1.0
Configs from pkg-config: {'include_dirs': ['/usr/local/Cellar/leptonica/1.78.0/include', '/usr/local/Cellar/tesseract/4.1.0/include'], 'library_dirs': ['/usr/local/Cellar/tesseract/4.1.0/lib', '/usr/local/Cellar/leptonica/1.78.0/lib'], 'libraries': ['lept', 'tesseract'], 'cython_compile_time_env': {'TESSERACT_VERSION': 67174400}}
running bdist_wheel
running build
running build_ext
building 'tesserocr' extension
creating build
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/Users/yzchen/anaconda3/include -arch x86_64 -I/Users/yzchen/anaconda3/include -arch x86_64 -I/usr/local/Cellar/leptonica/1.78.0/include -I/usr/local/Cellar/tesseract/4.1.0/include -I/Users/yzchen/anaconda3/include/python3.7m -c tesserocr.cpp -o build/temp.macosx-10.7-x86_64-3.7/tesserocr.o -std=c++11 -DUSE_STD_NAMESPACE
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]
tesserocr.cpp:622:10: fatal error: 'ios' file not found
#include "ios"
^~~~~
1 warning and 1 error generated.
error: command 'gcc' failed with exit status 1
----------------------------------------
ERROR: Failed building wheel for tesserocr
Running setup.py clean for tesserocr
Failed to build tesserocr
Installing collected packages: tesserocr
Running setup.py install for tesserocr ... error
ERROR: Command errored out with exit status 1:
command: /Users/yzchen/anaconda3/bin/python -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/private/var/folders/_w/_62wz17d3zq1lwsv8cbrgrpm0000gn/T/pip-install-n2_smac6/tesserocr/setup.py'"'"'; __file__='"'"'/private/var/folders/_w/_62wz17d3zq1lwsv8cbrgrpm0000gn/T/pip-install-n2_smac6/tesserocr/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/_w/_62wz17d3zq1lwsv8cbrgrpm0000gn/T/pip-record-dd0zgahn/install-record.txt --single-version-externally-managed --compile
cwd: /private/var/folders/_w/_62wz17d3zq1lwsv8cbrgrpm0000gn/T/pip-install-n2_smac6/tesserocr/
Complete output (15 lines):
Supporting tesseract v4.1.0
Configs from pkg-config: {'include_dirs': ['/usr/local/Cellar/leptonica/1.78.0/include', '/usr/local/Cellar/tesseract/4.1.0/include'], 'library_dirs': ['/usr/local/Cellar/leptonica/1.78.0/lib', '/usr/local/Cellar/tesseract/4.1.0/lib'], 'libraries': ['lept', 'tesseract'], 'cython_compile_time_env': {'TESSERACT_VERSION': 67174400}}
running install
running build
running build_ext
building 'tesserocr' extension
creating build
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/Users/yzchen/anaconda3/include -arch x86_64 -I/Users/yzchen/anaconda3/include -arch x86_64 -I/usr/local/Cellar/leptonica/1.78.0/include -I/usr/local/Cellar/tesseract/4.1.0/include -I/Users/yzchen/anaconda3/include/python3.7m -c tesserocr.cpp -o build/temp.macosx-10.7-x86_64-3.7/tesserocr.o -std=c++11 -DUSE_STD_NAMESPACE
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]
tesserocr.cpp:622:10: fatal error: 'ios' file not found
#include "ios"
^~~~~
1 warning and 1 error generated.
error: command 'gcc' failed with exit status 1
----------------------------------------
ERROR: Command errored out with exit status 1: /Users/yzchen/anaconda3/bin/python -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/private/var/folders/_w/_62wz17d3zq1lwsv8cbrgrpm0000gn/T/pip-install-n2_smac6/tesserocr/setup.py'"'"'; __file__='"'"'/private/var/folders/_w/_62wz17d3zq1lwsv8cbrgrpm0000gn/T/pip-install-n2_smac6/tesserocr/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/_w/_62wz17d3zq1lwsv8cbrgrpm0000gn/T/pip-record-dd0zgahn/install-record.txt --single-version-externally-managed --compile Check the logs for full command output.
或者超时
使用以下命令即可:
CC=clang XCC=clang++ CPPFLAGS="-stdlib=libc++ -DUSE_STD_NAMESPACE -mmacosx-version-min=10.8" pip3 install -i https://pypi.doubanio.com/simple/ tesserocr pillow