Comments (12)
Did you install leptonica?
from tesserocr.
Yes, Leptonica is installed, as described here: https://macappstore.org/leptonica/
from tesserocr.
Can you please modify #include "leptonica/allheaders.h"
to #include "allheaders.h"
?
from tesserocr.
where do I need to make this change? Where does tesserocr.cpp come from?
from tesserocr.
tesserocr.cpp
line 796 - it is in error message
from tesserocr.
Where do i find tesserocrp.cpp? It's not in the github repo and I don't think it's on my machine before I pip install tesserocr.
from tesserocr.
tesserocr.cpp is generated file by setup.py ;-)
So can you please provide a full log of the following commands?
git clone https://github.com/sirfz/tesserocr.git
cd tesserocr
python3 setup.py build
from tesserocr.
(base) dickr@NICOLASs-MacBook-Pro tesserocr % python setup.py build
Supporting tesseract v5.3.0
Tesseract major version 5
Building with configs: {'libraries': ['tesseract', 'lept'], 'compile_time_env': {'TESSERACT_MAJOR_VERSION': 5, 'TESSERACT_VERSION': 84082688}}
running build
running build_ext
Compiling tesserocr.pyx because it changed.
[1/1] Cythonizing tesserocr.pyx
Detected compiler: unix
building 'tesserocr' extension
creating build
creating build/temp.macosx-11.1-arm64-cpython-39
clang -Wno-unused-result -Wsign-compare -Wunreachable-code -DNDEBUG -fwrapv -O2 -Wall -fPIC -O2 -isystem /Users/dickr/opt/anaconda3/include -arch arm64 -I/Users/dickr/opt/anaconda3/include -fPIC -O2 -isystem /Users/dickr/opt/anaconda3/include -arch arm64 -I/Users/dickr/opt/anaconda3/include/python3.9 -c tesserocr.cpp -o build/temp.macosx-11.1-arm64-cpython-39/tesserocr.o -std=c++11 -DUSE_STD_NAMESPACE
tesserocr.cpp:796:10: fatal error: 'leptonica/allheaders.h' file not found
#include "leptonica/allheaders.h"
^~~~~~~~~~~~~~~~~~~~~~~~
1 error generated.
error: command '/usr/bin/clang' failed with exit code 1
from tesserocr.
Any suggestions what we can do about this?
from tesserocr.
First of all: I am not mac user ;-)
Can you run and provide output of pkg-config --libs --cflags lept
?
Generally you need to specify path where compiler (clang) can find leptonica header file. So first of all please find there is located "allheaders.h" file.
Then you will need something like this (I found it on internet, so I hope it is correct):
export CPLUS_INCLUDE_PATH="${CPLUS_INCLUDE_PATH:+${CPLUS_INCLUDE_PATH}:}<path_to_leptonica>"
- you can try this:
brew install tesseract
export LIBRARY_PATH="/opt/homebrew/lib"
export CPATH="/opt/homebrew/include"
After this setting try to install tesserocr (python setup.py build
).
from tesserocr.
export LIBRARY_PATH="CPPFLAGS=-I/opt/homebrew/Cellar/leptonica/1.82.0_1/include/leptonica"
worked. thanks
from tesserocr.
For me, doing the 2nd part of @zdenop 's solution worked
export LIBRARY_PATH="/opt/homebrew/lib"
export CPATH="/opt/homebrew/include"
from tesserocr.
Related Issues (20)
- ImportError: dlopen HOT 4
- Publish wheels for aarch64 HOT 2
- symbol not found in flat namespace HOT 7
- `GetTextDirection` + `MapWordConfidences` crash python HOT 2
- in loop `GetChoiceIterator` crashs python if result is empty
- `GetDatapath` can't find the default path that tesseract should find on windows HOT 7
- `MapWordConfidences` throw 'No text returned' when the result is empty
- ImportError: DLL load failed while importing tesserocr: The specified module could not be found. HOT 6
- Side effects of running tesserocr-recognize as a worker HOT 1
- Can't directly use image_to_text for invalid path for tessdata. HOT 2
- Segfault when used with PyMuPDF (aka fitz) HOT 1
- tesserocr.tesseract_version() Missing Libaries HOT 2
- can't ocr anything with 2.6.2 HOT 2
- Missing support for Tesseract5? HOT 18
- No definition found for "tesserocr" HOT 2
- user patterns are not considered HOT 4
- does not build on current Tesseract anymore HOT 8
- Problem with API HOT 2
- Allow to show tesseract and leptonica messages (easily) HOT 2
- `PY_MAJOR_VERSION > 3` HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from tesserocr.