Giter VIP home page Giter VIP logo

Comments (38)

sirfz avatar sirfz commented on May 13, 2024 6

Thanks for the heads up, changes are simple based on what I read in the wiki. Will implement them soon.

from tesserocr.

sirfz avatar sirfz commented on May 13, 2024 2

pip install tesserocr installs the latest version from pypi. If you wish to install tesserocr against tesseract 4.0 you'll need to clone the repo and checkout the tesseract4 branch then pip install . while in the repo's root directory. No need to specify the CPPFLAGS variable, the setup automatically takes care of that for you.

from tesserocr.

bpotard avatar bpotard commented on May 13, 2024 2

How did you switch to the tesseract4 branch? Git is a bit peculiar, so something like git branch tesseract4 does not switch to an existing branch but create a new one. You have to checkout the branch, or safer, clone directly the branch you want, e.g.:
git clone -b tesseract4 https://github.com/sirfz/tesserocr.git

git status should tell you:

On branch tesseract4
Your branch is up-to-date with 'origin/tesseract4'.
nothing to commit, working directory clean

from tesserocr.

sirfz avatar sirfz commented on May 13, 2024 2

@johannesmik tesseract 4 is already supported in the latest release (tesseract4 has been merged with master).

from tesserocr.

sirfz avatar sirfz commented on May 13, 2024 1

Maybe pip is installing against a different version of Python than the one you're running? Check the output of pip --version, it should show you which Python version it's using.

from tesserocr.

zivkovic-msz avatar zivkovic-msz commented on May 13, 2024 1

Bless your soul. Problem fixed! 👍

from tesserocr.

bpotard avatar bpotard commented on May 13, 2024 1

Hello,

I have tried the 4.0 branch, and it seems there is something seriously broken with the "SetRectangle" API call when using tesseract 4. I cannot tell whether it is in tesserocr or in tesseract itself though!

Your vanilla "GetComponentImages example" gives me this with tesseract 3.04 installed:

Found 8 textline image components.
Box[0]: x=36, y=92, w=544, h=30, confidence: 89, text: This is a lot of 12 point text to test the
Box[1]: x=36, y=126, w=582, h=31, confidence: 90, text: ocr code and see if it works on all types
Box[2]: x=36, y=160, w=187, h=24, confidence: 90, text: of file format.
Box[3]: x=36, y=194, w=549, h=31, confidence: 90, text: The quick brown dog jumped over the
Box[4]: x=37, y=228, w=548, h=31, confidence: 91, text: lazy fox. The quick brown dog jumped
Box[5]: x=36, y=262, w=561, h=31, confidence: 91, text: over the lazy fox. The quick brown dog
Box[6]: x=43, y=296, w=518, h=31, confidence: 91, text: jumped over the lazy fox. The quick
Box[7]: x=37, y=330, w=524, h=31, confidence: 90, text: brown dog jumped over the lazy fox.

But with tesseract 4 from git:

Found 8 textline image components.
Box[0]: x=36, y=92, w=544, h=30, confidence: 31, text: s
Box[1]: x=36, y=126, w=582, h=31, confidence: 29, text: s
Box[2]: x=36, y=160, w=187, h=24, confidence: 40, text: s
Box[3]: x=36, y=194, w=549, h=31, confidence: 28, text: s
Box[4]: x=37, y=228, w=548, h=31, confidence: 0, text: h
Box[5]: x=36, y=262, w=561, h=31, confidence: 27, text: s
Box[6]: x=43, y=296, w=518, h=31, confidence: 16, text: s
Box[7]: x=37, y=330, w=524, h=31, confidence: 13, text: s

In both cases I used the tesseract4 branch. I have tried to investigate a bit, from my initial estimate it seems the SetRectangle make the OCR returns gibberish unless the box covers the whole height of the document.

For example, if you replace the box of the SetRectangle argument of the "GetComponentImages example" by this:

box = {'x':400, 'y': 50 * i, 'w': 240, 'h': 480 - 50 * i}

Then you obtain:

(...)
Box[1]: x=400, y=50, w=240, h=430, confidence: 87, text: - This is a Ik
_ ocr code and

- The quick:
_ lazy fox. T
_ over the laz
__ jumped
_ brown de
(...)

But with:

box = {'x':400, 'y': 50 * i, 'w': 240, 'h': 470 - 50 * i}

you get:

(...)
Box[1]: x=400, y=50, w=240, h=420, confidence: 61, text: - [NS s a IC
_ OEL COSC TIC

-_ Ine quICR:
- 19A. 1.
_ Ove! mo 244
-_ Jumped
_ gag
(...)

Hope that helps!

from tesserocr.

sirfz avatar sirfz commented on May 13, 2024 1

@feliciatong Are you sure you're installing v2.2.0rc1 in the Python 3 case? If yes, can you try this command?

CPPFLAGS=-std=c++11 pip3 install .

(although this is already handled automatically in v2.2).

from tesserocr.

sirfz avatar sirfz commented on May 13, 2024 1

Tested with Python 3.6:

$ python3.6 setup.py test
Supporting tesseract v3.05.00
Configs from pkg-config: {'include_dirs': ['/usr/local/include'], 'library_dirs': ['/usr/local/lib'], 'libraries': ['lept', 'tesseract'], 'cython_compile_time_env': {'TESSERACT_VERSION': 197888}}
/usr/lib/python3/dist-packages/setuptools/dist.py:333: UserWarning: Normalizing '2.2.0-rc2' to '2.2.0rc2'
  normalized_version,
running test
running egg_info
creating tesserocr.egg-info
writing tesserocr.egg-info/PKG-INFO
writing dependency_links to tesserocr.egg-info/dependency_links.txt
writing top-level names to tesserocr.egg-info/top_level.txt
writing manifest file 'tesserocr.egg-info/SOURCES.txt'
Compiling tesserocr.pyx because it changed.
[1/1] Cythonizing tesserocr.pyx
reading manifest file 'tesserocr.egg-info/SOURCES.txt'
reading manifest template 'MANIFEST.in'
warning: no previously-included files found matching '*.so'
writing manifest file 'tesserocr.egg-info/SOURCES.txt'
running build_ext
building 'tesserocr' extension
creating build
creating build/temp.linux-x86_64-3.6
x86_64-linux-gnu-gcc -pthread -DNDEBUG -g -fwrapv -O2 -Wall -Wstrict-prototypes -g -fdebug-prefix-map=/build/python3.6-d0prx8/python3.6-3.6.1=. -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -fPIC -I/usr/local/include -I/usr/include/python3.6m -c tesserocr.cpp -o build/temp.linux-x86_64-3.6/tesserocr.o -std=c++11
cc1plus: warning: command line option ‘-Wstrict-prototypes’ is valid for C/ObjC but not for C++
creating build/lib.linux-x86_64-3.6
x86_64-linux-gnu-g++ -pthread -shared -Wl,-O1 -Wl,-Bsymbolic-functions -Wl,-Bsymbolic-functions -Wl,-z,relro -Wl,-Bsymbolic-functions -Wl,-z,relro -g -fdebug-prefix-map=/build/python3.6-d0prx8/python3.6-3.6.1=. -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 build/temp.linux-x86_64-3.6/tesserocr.o -L/usr/local/lib -llept -ltesseract -o build/lib.linux-x86_64-3.6/tesserocr.cpython-36m-x86_64-linux-gnu.so
Generating grammar tables from /usr/lib/python3.6/lib2to3/Grammar.txt
Generating grammar tables from /usr/lib/python3.6/lib2to3/PatternGrammar.txt
copying build/lib.linux-x86_64-3.6/tesserocr.cpython-36m-x86_64-linux-gnu.so -> 
test_clear (tests.test_api.TestTessBaseApi)
Test Clear. ... ok
test_context_manager (tests.test_api.TestTessBaseApi)
Test context manager behavior ... ok
test_data_path (tests.test_api.TestTessBaseApi)
Test GetDatapath and Init with an invalid data path. ... ok
test_detect_os (tests.test_api.TestTessBaseApi)
Test DetectOS and DetectOrientationScript (tesseract v4+). ... ok
test_empty_getcomponents (tests.test_api.TestTessBaseApi) ... ok
test_empty_small_getcomponents (tests.test_api.TestTessBaseApi) ... ok
test_end (tests.test_api.TestTessBaseApi)
Test End. ... ok
test_image (tests.test_api.TestTessBaseApi)
Test SetImage and GetUTF8Text. ... ok
test_image_file (tests.test_api.TestTessBaseApi)
Test SetImageFile and GetUTF8Text. ... ok
test_init (tests.test_api.TestTessBaseApi)
Test Init calls with different lang and oem. ... ok
test_init_full (tests.test_api.TestTessBaseApi)
Test InitFull. ... ok
test_langs (tests.test_api.TestTessBaseApi)
Test get langs methods. ... ok
test_page_seg_mode (tests.test_api.TestTessBaseApi)
Test SetPageSegMode and GetPageSegMode. ... ok
test_rectangle (tests.test_api.TestTessBaseApi)
Test SetRectangle. ... ok
test_thresholded_image (tests.test_api.TestTessBaseApi)
Test GetThresholdedImage and GetThresholdedImageScaleFactor. ... ok
test_variables (tests.test_api.TestTessBaseApi)
Test SetVariable and GetVariableAsString. ... ok
test_word_confidences (tests.test_api.TestTessBaseApi)
Test AllWordConfidences and MapWordConfidences. ... ok

----------------------------------------------------------------------
Ran 17 tests in 8.967s

OK

from tesserocr.

feliciatong avatar feliciatong commented on May 13, 2024 1

@sirfz Thank you for trying it out and share with us the result. I realised you were using gcc while my machine not sure why it chosen Xcode clang for this setup.py. Therefore I got error on installation but yours don't. I have set environment pointing to use gcc instead, it is working now!

from tesserocr.

sirfz avatar sirfz commented on May 13, 2024 1

From the looks of it, the setup did not Cythonize tesserocr.pyx to tesserocr.cpp in your case although pip should have handled that. Maybe you need to update setuptools or pip (or both), you can also try installing Cython manually before installing tesserocr.

from tesserocr.

mit456 avatar mit456 commented on May 13, 2024 1

@eugene123tw I switched to pyocr.

from tesserocr.

sirfz avatar sirfz commented on May 13, 2024

Pushed the updates to branch tesseract4, try it out if you can and let me know if anything's missing/not working properly.

Main changes include:

  • Two new OEM enums: OEM.LSTM_ONLY and OEM.TESSERACT_LSTM_COMBINED (tesseract 4.0+)
  • Two new API methods: GetTSVText and DetectOrientationScript (tesseract 4.0+)
  • PyTessBaseApi.__init__ now accepts a new attribute oem (OCR engine mode: OEM.DEFAULT by default).
  • file_to_text and image_to_text functions now also accept the oem attribute as above.

from tesserocr.

kowen0813 avatar kowen0813 commented on May 13, 2024

Thank you. It works and useful for us.

from tesserocr.

zivkovic-msz avatar zivkovic-msz commented on May 13, 2024

I am trying to install tesserocr for tesseract 4.0 using CPPFLAGS=-std=c++11 pip install tesserocr but I am getting an error. Could you please advise on how to fix it? Oddly enough the aforementioned command worked a few weeks ago on a different machine I was working on.

I attached the error message here:
tesserocr_error_msg.txt

Tesseract and Leptonica installation info shown below:

root@debian:/home/mihailo/Downloads/tesserocr# ldconfig -p | grep tesseract
libtesseract.so.4 (libc6,x86-64) => /usr/local/lib/libtesseract.so.4
libtesseract.so (libc6,x86-64) => /usr/local/lib/libtesseract.so
root@debian:/home/mihailo/Downloads/tesserocr# ldconfig -p | grep lept
liblept.so.5 (libc6,x86-64) => /usr/local/lib/liblept.so.5
liblept.so (libc6,x86-64) => /usr/local/lib/liblept.so
root@debian:/home/mihailo/Downloads/tesserocr# tesseract -v
tesseract 4.00.00alpha-296-gbd45b3a
leptonica-1.74.1
libjpeg 6b (libjpeg-turbo 1.3.1) : libpng 1.2.50 : libtiff 4.0.3 : zlib 1.2.8

Found AVX
Found SSE

from tesserocr.

zivkovic-msz avatar zivkovic-msz commented on May 13, 2024

I tried that, and while I do see "Successfully installed tesserocr-2.2.0b0," when I try to import tesserocr I get an error. I really appreciate the help btw.

image

from tesserocr.

NasarudinAbdulShukor avatar NasarudinAbdulShukor commented on May 13, 2024

I compiled tesserocr by cloning the repo, cd into the repository, git checkout tesseract4 and pip install . The installation has no problem. But when I check the version of tesseract, it showed that the version is 3.05 not 4.
screen shot 2017-03-30 at 11 17 48 pm

How do I fix this problem? I am on OS X El Capitan. I installed tesserocr in python virtual environment

from tesserocr.

sirfz avatar sirfz commented on May 13, 2024

You need to install tesseract 4, tesserocr just compiles against the existing tesseract installation on your machine. In your case, you seem to have tesseract 3.05 installed.

from tesserocr.

NasarudinAbdulShukor avatar NasarudinAbdulShukor commented on May 13, 2024

You are right. I did not realize that. Thank you for pointing that out.

from tesserocr.

bpotard avatar bpotard commented on May 13, 2024
Box[1]: x=400, y=50, w=240, h=430, confidence: 87, text: - This is a Ik
_ ocr code and

phototest

Now that I think about it, this is not even working correctly anyway! It looks like it mostly recognised from the left side of the image anyway instead of the right side.

from tesserocr.

bpotard avatar bpotard commented on May 13, 2024

It appears the issue is in tesseract.

from tesserocr.

amitdo avatar amitdo commented on May 13, 2024

any plan to porting tesseract 4.0 alpha, 4.0 add new OCR engine based on LSTM neural networks is more powerful and fast (Hardware acceleration)

Actually, the LSTM engine is slower than the legacy engine for most languages.

from tesserocr.

amitdo avatar amitdo commented on May 13, 2024

... but you'll get more accurate results in most cases with the LSTM engine.

from tesserocr.

msaada avatar msaada commented on May 13, 2024

Hi !

I installed tesseract 4.0 on my EC2
tesseract --version

tesseract 4.00.00alpha
leptonica-1.73
libjpeg 6b (libjpeg-turbo 1.2.90) : libpng 1.2.49 : libtiff 4.0.3 : zlib 1.2.8 : libwebp 0.3.0

Cloned the tesserocr repo and checked out to tesseract4 branch :
git status

On branch tesseract4
nothing to commit, working directory clean

But when I try to install tesserocr with
pip install .
The 2.1.3 is installed.

Do I need to configure some flags to install it ?

from tesserocr.

sirfz avatar sirfz commented on May 13, 2024

@msaada verify that pip is using your default python version (pip --version) as it might be installing tesserocr for Python 3 while you're using Python 2.

from tesserocr.

msaada avatar msaada commented on May 13, 2024

@sirfz I'm using pip3.4 to install the packaqe and I'm testing with python3.4

And when the install finishes it says:
Successfully installed tesserocr-2.1.3

from tesserocr.

sirfz avatar sirfz commented on May 13, 2024

In that case verify that you're actually inside the repo with the tesseract4 branch checked out (i.e. try to understand why it's still seeing 2.1.3 if you're actually in the correct branch which should have - as of this time - 2.2.0rc1).

from tesserocr.

msaada avatar msaada commented on May 13, 2024

I cloned the tesserocr repo and checked out to tesseract4 branch :
git status

On branch tesseract4
nothing to commit, working directory clean

from tesserocr.

msaada avatar msaada commented on May 13, 2024

@bpotard Nicely spotted ! The installation worked after the new clone

from tesserocr.

feliciatong avatar feliciatong commented on May 13, 2024

Hi all,

I need a little help here. I am able to run "pip install ." and successfully installed tesserocr-2.2.0rc1 to my machine. However, I need this to be on python 3.6. I have tried to execute "pip3 install .", "pip3.6 install ." and "python3 setup.py install", none of these working. The error was

In file included from tesserocr.cpp:487:
In file included from /usr/local/include/tesseract/genericvector.h:29:
/usr/local/include/tesseract/helpers.h:50:10: error: no member named 'hash' in namespace 'std'
std::hashstd::string hasher;
~~~~~^
/usr/local/include/tesseract/helpers.h:50:26: error: expected '(' for function-style cast or type construction
std::hashstd::string hasher;
~~~~~~~~~~~^
/usr/local/include/tesseract/helpers.h:50:28: error: use of undeclared identifier 'hasher'
std::hashstd::string hasher;
^
/usr/local/include/tesseract/helpers.h:51:34: error: use of undeclared identifier 'hasher'
set_seed(static_cast(hasher(str)));
^
4 errors generated.

Is there anyone who able to install this wrapper using python 3? Appreciate your help, thanks.

>> pip --version
pip 9.0.1 from /Library/Python/2.7/site-packages/pip-9.0.1-py2.7.egg (python 2.7)
>> pip3 --version
pip 9.0.1 from /Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages (python 3.6)

from tesserocr.

feliciatong avatar feliciatong commented on May 13, 2024

@sirfz Thanks for your prompt response!

My pip3 --version is pointing to python 3.6. I did tried that command "CPPFLAGS=-std=c++11 pip3 install ." unfortunately, still same error. Since v2.2.0rc1 was successfully installed in python 2.7, I have tested it by writing a test.py tesserocr on a jpeg, it works as expected. tesserocr.tesseract_version() is showing "tesseract 4.00.00alpha". I'm using macbook.

May I know which version of python 3 that you have tried to install with it, and it works?

from tesserocr.

sirfz avatar sirfz commented on May 13, 2024

I tested with Python 3.5 but I see no reason why this error should happen in 3.6, it has to be something in your environment. I'll test it with Python 3.6 when I have some time and let you know the result.

from tesserocr.

glbrtchen avatar glbrtchen commented on May 13, 2024

I tried all the method above on master branch and tesseract4 branch, and using pip to install. All of the methods return a error about gcc-4.8.real: error: tesserocr.cpp: No such file or directory, need some help...

/usr/local/lib/python2.7/dist-packages/pip/_vendor/requests/packages/urllib3/util/ssl_.py:318: SNIMissingWarning: An HTTPS request has been made, but the SNI (Subject Name Indication) extension to TLS is not available on this platform. This may cause the server to present an incorrect TLS certificate, which can cause validation failures. You can upgrade to a newer version of Python to solve this. For more information, see https://urllib3.readthedocs.io/en/latest/security.html#snimissingwarning.
  SNIMissingWarning
/usr/local/lib/python2.7/dist-packages/pip/_vendor/requests/packages/urllib3/util/ssl_.py:122: InsecurePlatformWarning: A true SSLContext object is not available. This prevents urllib3 from configuring SSL appropriately and may cause certain SSL connections to fail. You can upgrade to a newer version of Python to solve this. For more information, see https://urllib3.readthedocs.io/en/latest/security.html#insecureplatformwarning.
  InsecurePlatformWarning
  Using cached tesserocr-2.2.1.tar.gz

Building wheels for collected packages: tesserocr
  Running setup.py bdist_wheel for tesserocr ... error
  Complete output from command /usr/bin/python -u -c "import setuptools, tokenize;__file__='/tmp/pip-build-ODiBpo/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 /tmp/tmpY7d2HApip-wheel- --python-tag cp27:
  Supporting tesseract v4.00.00dev
  Configs from pkg-config: {'libraries': ['lept', 'tesseract'], 'cython_compile_time_env': {'TESSERACT_VERSION': 262144}, 'library_dirs': ['/usr/local/lib'], 'include_dirs': ['/usr/local/include']}
  running bdist_wheel
  running build
  running build_ext
  building 'tesserocr' extension
  creating build
  creating build/temp.linux-x86_64-2.7
  x86_64-linux-gnu-gcc -pthread -fno-strict-aliasing -DNDEBUG -g -fwrapv -O2 -Wall -Wstrict-prototypes -fPIC -I/usr/local/include -I/usr/include/python2.7 -c tesserocr.cpp -o build/temp.linux-x86_64-2.7/tesserocr.o -std=c++11
  gcc-4.8.real: error: tesserocr.cpp: No such file or directory
  gcc-4.8.real: fatal error: no input files
  compilation terminated.
  error: command 'x86_64-linux-gnu-gcc' failed with exit status 4
  
  ----------------------------------------
  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 /usr/bin/python -u -c "import setuptools, tokenize;__file__='/tmp/pip-build-ODiBpo/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 /tmp/pip-DqzXA6-record/install-record.txt --single-version-externally-managed --compile:
    Supporting tesseract v4.00.00dev
    Configs from pkg-config: {'libraries': ['lept', 'tesseract'], 'cython_compile_time_env': {'TESSERACT_VERSION': 262144}, 'library_dirs': ['/usr/local/lib'], 'include_dirs': ['/usr/local/include']}
    running install
    running build
    running build_ext
    building 'tesserocr' extension
    creating build
    creating build/temp.linux-x86_64-2.7
    x86_64-linux-gnu-gcc -pthread -fno-strict-aliasing -DNDEBUG -g -fwrapv -O2 -Wall -Wstrict-prototypes -fPIC -I/usr/local/include -I/usr/include/python2.7 -c tesserocr.cpp -o build/temp.linux-x86_64-2.7/tesserocr.o -std=c++11
    gcc-4.8.real: error: tesserocr.cpp: No such file or directory
    gcc-4.8.real: fatal error: no input files
    compilation terminated.
    error: command 'x86_64-linux-gnu-gcc' failed with exit status 4
    
    ----------------------------------------
Command "/usr/bin/python -u -c "import setuptools, tokenize;__file__='/tmp/pip-build-ODiBpo/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 /tmp/pip-DqzXA6-record/install-record.txt --single-version-externally-managed --compile" failed with error code 1 in /tmp/pip-build-ODiBpo/tesserocr/

from tesserocr.

mit456 avatar mit456 commented on May 13, 2024

Hi all,

I need little help, I am using python2.7 virtualenv for my project and I want to setup tesserocr with tesseract 4.00.00alpha, if I check the version of tesseract using tesseract -v, I get the following output -

tesseract 4.00.00alpha
leptonica-1.73
libgif 5.1.2 : libjpeg 8d (libjpeg-turbo 1.4.2) : libpng 1.2.54 : libtiff 4.0.6 : zlib 1.2.8 : libwebp 0.4.4 : libopenjp2 2.1.0

Found AVX2
Found AVX
Found SSE

I cloned this repo, couldn't find tesseract4 branch so I tried pip install . on master branch itself and got the following output -
Processing /home/abc/Projects/image-processing/tesserocr
Installing collected packages: tesserocr
Running setup.py install for tesserocr ... done
Successfully installed tesserocr-2.2.2

After installing I tried print tesserocr.tesseract_version() which is still giving tesseract 3.04.01 and this is the output from above print -

tesseract 3.04.01
leptonica-1.73
libgif 5.1.2 : libjpeg 8d (libjpeg-turbo 1.4.2) : libpng 1.2.54 : libtiff 4.0.6 : zlib 1.2.8 : libwebp 0.4.4 : libopenjp2 2.1.0

Any idea why is this happening?

from tesserocr.

sirfz avatar sirfz commented on May 13, 2024

Make sure you delete older versions of tesseract before installing v4, then install tesserocr.

from tesserocr.

johannesmik avatar johannesmik commented on May 13, 2024

Is there any update on that issue? It looks like the branch tesseract4 isn't there anymore.

from tesserocr.

sashaostr avatar sashaostr commented on May 13, 2024

I have tesseract 4.0alpha installed and running on my centos7 - from command line and in code using pyocr it works perfect.

I was able to successfully install the master branch using "pip install git+https://github.com/sirfz/tesserocr.git" for python3.
But when trying to import in code I get error:

---> 38 from tesserocr import PyTessBaseAPI, RIL
ImportError: libtesseract.so.4: cannot open shared object file: No such file or directory

When I tried to installed like this
PKG_CONFIG_PATH=/usr/local/lib/pkgconfig LIBLEPT_HEADERSDIR=/usr/local/include LDFLAGS="-L/usr/local/lib" CFLAGS="-I/usr/local/include" pip install git+https://github.com/sirfz/tesserocr.git
I get:

---> 38 from tesserocr import PyTessBaseAPI, RIL
ImportError: liblept.so.5: cannot open shared object file: No such file or directory

Any help would be appreciated!


  • checked:
    /usr/local/lib contains libtesseract.so.4 -> libtesseract.so.4.0.0
    /usr/local/lib contains liblept.so.5 -> liblept.so.5.0.1
  • checked: env contains /usr/local/lib in $PATH and in $LD_LIBRARY_PATH
  • checked:
(anaconda3-4.3.1) [ds@lab1 tesserocr]$ tesseract -v
tesseract 4.00.00alpha
 leptonica-1.74.4
  libjpeg 6b (libjpeg-turbo 1.2.90) : libpng 1.5.13 : libtiff 4.0.3 : zlib 1.2.7
 Found AVX
 Found SSE

from tesserocr.

eugene123tw avatar eugene123tw commented on May 13, 2024

@mit456 I am having the same issue. Did you find a solution?

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.