Failed building wheel for tesserocr (未解決)
hewudeMacBook-Pro:~ whe$ pip3 install tesserocr pillow
Collecting tesserocr
Using cached https://files.pythonhosted.org/packages/f8/6d/4e81e041f33a4419e59edcb1dbdf3c56e9393f60f5ef531381bd67a1339b/tesserocr-2.3.1.tar.gz
Requirement already satisfied: pillow in /anaconda3/lib/python3.6/site-packages (5.3.0)
Building wheels for collected packages: tesserocr
Running setup.py bdist_wheel for tesserocr ... error
Complete output from command /anaconda3/bin/python -u -c "import setuptools, tokenize;__file__='/private/var/folders/4_/s0cnjszj5j35hn4hnp4nnmhc0000gn/T/pip-install-g97h4t43/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/4_/s0cnjszj5j35hn4hnp4nnmhc0000gn/T/pip-wheel-rrahokmz --python-tag cp36:
Supporting tesseract v4.0.0
Configs from pkg-config: {'include_dirs': ['/usr/local/Cellar/leptonica/1.76.0/include', '/usr/local/Cellar/tesseract/4.0.0/include'], 'library_dirs': ['/usr/local/Cellar/leptonica/1.76.0/lib', '/usr/local/Cellar/tesseract/4.0.0/lib'], 'libraries': ['lept', 'tesseract'], 'cython_compile_time_env': {'TESSERACT_VERSION': 262144}}
running bdist_wheel
running build
running build_ext
building 'tesserocr' extension
creating build
creating build/temp.macosx-10.7-x86_64-3.6
gcc -Wno-unused-result -Wsign-compare -Wunreachable-code -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -I/anaconda3/include -arch x86_64 -I/anaconda3/include -arch x86_64 -I/usr/local/Cellar/leptonica/1.76.0/include -I/usr/local/Cellar/tesseract/4.0.0/include -I/anaconda3/include/python3.6m -c tesserocr.cpp -o build/temp.macosx-10.7-x86_64-3.6/tesserocr.o -std=c++11 -DUSE_STD_NAMESPACE
In file included from tesserocr.cpp:668:
In file included from /usr/local/Cellar/tesseract/4.0.0/include/tesseract/genericvector.h:28:
In file included from /usr/local/Cellar/tesseract/4.0.0/include/tesseract/tesscallback.h:22:
/usr/local/Cellar/tesseract/4.0.0/include/tesseract/host.h:30:10: fatal error: 'cinttypes' file not found
#include <cinttypes> // PRId32, ...
^~~~~~~~~~~
1 error generated.
error: command 'gcc' failed with exit status 1
----------------------------------------
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
Complete output from command /anaconda3/bin/python -u -c "import setuptools, tokenize;__file__='/private/var/folders/4_/s0cnjszj5j35hn4hnp4nnmhc0000gn/T/pip-install-g97h4t43/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/4_/s0cnjszj5j35hn4hnp4nnmhc0000gn/T/pip-record-jqpxk9yz/install-record.txt --single-version-externally-managed --compile:
Supporting tesseract v4.0.0
Configs from pkg-config: {'include_dirs': ['/usr/local/Cellar/tesseract/4.0.0/include', '/usr/local/Cellar/leptonica/1.76.0/include'], 'library_dirs': ['/usr/local/Cellar/leptonica/1.76.0/lib', '/usr/local/Cellar/tesseract/4.0.0/lib'], 'libraries': ['tesseract', 'lept'], 'cython_compile_time_env': {'TESSERACT_VERSION': 262144}}
running install
running build
running build_ext
building 'tesserocr' extension
creating build
creating build/temp.macosx-10.7-x86_64-3.6
gcc -Wno-unused-result -Wsign-compare -Wunreachable-code -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -I/anaconda3/include -arch x86_64 -I/anaconda3/include -arch x86_64 -I/usr/local/Cellar/tesseract/4.0.0/include -I/usr/local/Cellar/leptonica/1.76.0/include -I/anaconda3/include/python3.6m -c tesserocr.cpp -o build/temp.macosx-10.7-x86_64-3.6/tesserocr.o -std=c++11 -DUSE_STD_NAMESPACE
In file included from tesserocr.cpp:668:
In file included from /usr/local/Cellar/tesseract/4.0.0/include/tesseract/genericvector.h:28:
In file included from /usr/local/Cellar/tesseract/4.0.0/include/tesseract/tesscallback.h:22:
/usr/local/Cellar/tesseract/4.0.0/include/tesseract/host.h:30:10: fatal error: 'cinttypes' file not found
#include <cinttypes> // PRId32, ...
^~~~~~~~~~~
1 error generated.
error: command 'gcc' failed with exit status 1
----------------------------------------
Command "/anaconda3/bin/python -u -c "import setuptools, tokenize;__file__='/private/var/folders/4_/s0cnjszj5j35hn4hnp4nnmhc0000gn/T/pip-install-g97h4t43/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/4_/s0cnjszj5j35hn4hnp4nnmhc0000gn/T/pip-record-jqpxk9yz/install-record.txt --single-version-externally-managed --compile" failed with error code 1 in /private/var/folders/4_/s0cnjszj5j35hn4hnp4nnmhc0000gn/T/pip-install-g97h4t43/tesserocr/
嘗試使用anaconda安裝
conda install -c simonflueckiger tesserocr
結果為:
hewudeMacBook-Pro:~ whe$ conda install -c simonflueckiger tesserocr
Solving environment: failed
PackagesNotFoundError: The following packages are not available from current channels:
- tesserocr
Current channels:
- https://conda.anaconda.org/simonflueckiger/osx-64
- https://conda.anaconda.org/simonflueckiger/noarch
- https://repo.anaconda.com/pkgs/main/osx-64
- https://repo.anaconda.com/pkgs/main/noarch
- https://repo.anaconda.com/pkgs/free/osx-64
- https://repo.anaconda.com/pkgs/free/noarch
- https://repo.anaconda.com/pkgs/r/osx-64
- https://repo.anaconda.com/pkgs/r/noarch
- https://repo.anaconda.com/pkgs/pro/osx-64
- https://repo.anaconda.com/pkgs/pro/noarch
To search for alternate channels that may provide the conda package you're
looking for, navigate to
https://anaconda.org
and use the search bar at the top of the page.
隨後將anaconda更新
$ conda update --all
問題仍未解決。