Giter Club home page Giter Club logo

Comments (12)

zdenop avatar zdenop commented on May 24, 2024

Did you install leptonica?

from tesserocr.

dickreuter avatar dickreuter commented on May 24, 2024

Yes, Leptonica is installed, as described here: https://macappstore.org/leptonica/

from tesserocr.

zdenop avatar zdenop commented on May 24, 2024

Can you please modify #include "leptonica/allheaders.h" to #include "allheaders.h"?

from tesserocr.

dickreuter avatar dickreuter commented on May 24, 2024

where do I need to make this change? Where does tesserocr.cpp come from?

from tesserocr.

zdenop avatar zdenop commented on May 24, 2024

tesserocr.cpp line 796 - it is in error message

from tesserocr.

dickreuter avatar dickreuter commented on May 24, 2024

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.

zdenop avatar zdenop commented on May 24, 2024

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.

dickreuter avatar dickreuter commented on May 24, 2024

(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.

dickreuter avatar dickreuter commented on May 24, 2024

Any suggestions what we can do about this?

from tesserocr.

zdenop avatar zdenop commented on May 24, 2024

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.

dickreuter avatar dickreuter commented on May 24, 2024

export LIBRARY_PATH="CPPFLAGS=-I/opt/homebrew/Cellar/leptonica/1.82.0_1/include/leptonica"

worked. thanks

from tesserocr.

isaackatayev avatar isaackatayev commented on May 24, 2024

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)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.