Code Monkey home page Code Monkey logo

Comments (25)

pindamonhangaba avatar pindamonhangaba commented on July 18, 2024 13

Need to install libleptonica-dev and libtesseract-dev.

from gosseract.

wozuo avatar wozuo commented on July 18, 2024 8

For anybody else experiencing this issue on an M1 mac:

CPATH=/opt/homebrew/include  LIBRARY_PATH=/opt/homebrew/lib go get -t github.com/otiai10/gosseract

from gosseract.

carbocation avatar carbocation commented on July 18, 2024 7

Actually, I think I have a solution. This problem can occur when the command-line developer tools for Xcode are not installed, or when you upgrade Xcode.

To fix, do the following:

brew remove tesseract
brew remove leptonica
xcode-select --install
brew install tesseract
go get github.com/otiai10/gosseract

This worked for me.

from gosseract.

huehnerhose avatar huehnerhose commented on July 18, 2024 5

I try to install gosseract on FreeBSD 11.0. I have tesseract and leptonica installed. My baseapi.h is at /usr/local/include/tesseract/baseapi.h but I still get:

go get github.com/otiai10/gosseract
# github.com/otiai10/gosseract/tesseract
tess.cpp:1:10: fatal error: 'tesseract/baseapi.h' file not found

Is there any way to tell where to find the file manually?

EDIT:
I hacked my way through the C imports changing:
tesseract/wrapper.go

 3 /*
 4 #cgo LDFLAGS: -L/usr/local/lib -llept -ltesseract
 5 #include "tess.h"
 6 */

and tesseract/tess.cpp

  1 #include "/usr/local/include/tesseract/baseapi.h"
  2 #include "/usr/local/include/leptonica/allheaders.h"

This way I got it working

from gosseract.

martinlindhe avatar martinlindhe commented on July 18, 2024 4

on osx, this is solved using homebrew: brew install tesseract

from gosseract.

geoherna avatar geoherna commented on July 18, 2024 2

+1

brew remove tesseract
brew remove leptonica
xcode-select --install
brew install tesseract
go get github.com/otiai10/gosseract

worked like a charm.

from gosseract.

sivsivsree avatar sivsivsree commented on July 18, 2024 2

For anybody else experiencing this issue on an M1 mac:

CPATH=/opt/homebrew/include  LIBRARY_PATH=/opt/homebrew/lib go get -t github.com/otiai10/gosseract

This works charm ๐Ÿš€

from gosseract.

novalagung avatar novalagung commented on July 18, 2024 1

I experienced same issue here. This error keep showing up even tesseract already installed. Am I missing something? I use yosemite

$ brew install tesseract
Warning: tesseract-3.04.00 already installed

$ brew install leptonica
Warning: leptonica-1.72 already installed

$ go test ./
# github.com/otiai10/gosseract/tesseract
tesseract/tess.cpp:1:10: fatal error: 'tesseract/baseapi.h' file not found
FAIL    github.com/otiai10/gosseract [build failed]

from gosseract.

liu-xuewen avatar liu-xuewen commented on July 18, 2024 1

windows get the same error? I put here. please help.

# github.com/otiai10/gosseract/tesseract
F:\mygo\src\github.com\otiai10\gosseract\tesseract\tess.cpp:1:31: fatal error: tesseract/baseapi.h: No such file or directory
compilation terminated.

from gosseract.

xgz123 avatar xgz123 commented on July 18, 2024 1

I follow this command
brew remove tesseract
brew remove leptonica
xcode-select --install
brew install tesseract
go get github.com/otiai10/gosseract

same error

same here
I have xcode-select installed already

from gosseract.

otiai10 avatar otiai10 commented on July 18, 2024

@martinlindhe @pindamonhangaba

Thanks!

It was a problem caused by updating my machie mavericks to yosemite

from gosseract.

otiai10 avatar otiai10 commented on July 18, 2024

s/It was/It might have been/

from gosseract.

otiai10 avatar otiai10 commented on July 18, 2024

@novalagung

Thanks for comment.

Did you try this?
#40 (comment)

from gosseract.

novalagung avatar novalagung commented on July 18, 2024

Thanks! is there any reference on how to install libleptonica-dev and libtesseract-dev on OSX? that would be very helpful for me.

#FYI I installed tesseract using homebrew.

from gosseract.

otiai10 avatar otiai10 commented on July 18, 2024

how about brew uinstall and install again?

from gosseract.

otiai10 avatar otiai10 commented on July 18, 2024

MacOSX 10.10.5

$ go test ./...
# github.com/otiai10/gosseract/tesseract
tesseract/tess.cpp:1:10: fatal error: 'tesseract/baseapi.h' file not found
FAIL    github.com/otiai10/gosseract [build failed]
$ brew search tesseract
tesseract
$ brew search leptonica
leptonica
homebrew/versions/leptonica169
$ brew install tesseract
==> Installing dependencies for tesseract: jpeg, libtiff, libpng, leptonica
==> Installing tesseract dependency: jpeg
==> Downloading https://homebrew.bintray.com/bottles/jpeg-8d.yosemite.bottle.2.tar.gz
######################################################################## 100.0%
==> Pouring jpeg-8d.yosemite.bottle.2.tar.gz
๐Ÿบ  /usr/local/Cellar/jpeg/8d: 18 files, 776K
==> Installing tesseract dependency: libtiff
==> Downloading https://homebrew.bintray.com/bottles/libtiff-4.0.6.yosemite.bottle.tar.gz
######################################################################## 100.0%
==> Pouring libtiff-4.0.6.yosemite.bottle.tar.gz
๐Ÿบ  /usr/local/Cellar/libtiff/4.0.6: 259 files, 3.9M
==> Installing tesseract dependency: libpng
==> Downloading https://homebrew.bintray.com/bottles/libpng-1.6.18.yosemite.bottle.tar.gz
######################################################################## 100.0%
==> Pouring libpng-1.6.18.yosemite.bottle.tar.gz
๐Ÿบ  /usr/local/Cellar/libpng/1.6.18: 17 files, 1.2M
==> Installing tesseract dependency: leptonica
==> Downloading https://homebrew.bintray.com/bottles/leptonica-1.72.yosemite.bottle.tar.gz
######################################################################## 100.0%
==> Pouring leptonica-1.72.yosemite.bottle.tar.gz
๐Ÿบ  /usr/local/Cellar/leptonica/1.72: 48 files, 5.6M
==> Installing tesseract
==> Downloading https://homebrew.bintray.com/bottles/tesseract-3.04.00.yosemite.bottle.tar.gz
######################################################################## 100.0%
==> Pouring tesseract-3.04.00.yosemite.bottle.tar.gz
๐Ÿบ  /usr/local/Cellar/tesseract/3.04.00: 74 files, 39M
$ go test ./...
ok      github.com/otiai10/gosseract    1.422s
?       github.com/otiai10/gosseract/tesseract  [no test files]
ok      github.com/otiai10/gosseract/tesseract/test 0.454s

from gosseract.

carbocation avatar carbocation commented on July 18, 2024

On El Capitan, installation of gosseract does not seem to work:

$ brew install tesseract
==> Installing dependencies for tesseract: leptonica
==> Installing tesseract dependency: leptonica
==> Downloading https://homebrew.bintray.com/bottles/leptonica-1.72.el_capitan.bottle.tar.gz
######################################################################## 100.0%
==> Pouring leptonica-1.72.el_capitan.bottle.tar.gz
๐Ÿบ  /usr/local/Cellar/leptonica/1.72: 48 files, 5.4M
==> Installing tesseract
==> Downloading https://homebrew.bintray.com/bottles/tesseract-3.04.00.el_capitan.bottle.tar.gz
######################################################################## 100.0%
==> Pouring tesseract-3.04.00.el_capitan.bottle.tar.gz
๐Ÿบ  /usr/local/Cellar/tesseract/3.04.00: 74 files, 39M
$ go get github.com/otiai10/gosseract
# github.com/otiai10/gosseract/tesseract
github.com/otiai10/gosseract/tesseract/tess.cpp:1:10: fatal error: 'tesseract/baseapi.h' file not found
$ go test
# github.com/otiai10/gosseract/tesseract
tesseract/tess.cpp:1:10: fatal error: 'tesseract/baseapi.h' file not found
FAIL    github.com/otiai10/gosseract [build failed
$ which tesseract
/usr/local/bin/tesseract

from gosseract.

otiai10 avatar otiai10 commented on July 18, 2024

Thank you! ๐Ÿบ

from gosseract.

novalagung avatar novalagung commented on July 18, 2024

+1

from gosseract.

zhujiarong avatar zhujiarong commented on July 18, 2024

I follow this command
brew remove tesseract
brew remove leptonica
xcode-select --install
brew install tesseract
go get github.com/otiai10/gosseract

same error

from gosseract.

otiai10 avatar otiai10 commented on July 18, 2024

did you get any error output while issuing those commands?

from gosseract.

zsq2010 avatar zsq2010 commented on July 18, 2024

how about on windows?

from gosseract.

otiai10 avatar otiai10 commented on July 18, 2024

@zsq2010 did you get the same error? Put that error here please. I'm sorry I'm not so familiar with Windows, just I'm reading https://github.com/tesseract-ocr/tesseract/wiki#windows.

from gosseract.

a8568730 avatar a8568730 commented on July 18, 2024

@martinlindhe @pindamonhangaba

Thanks!

from gosseract.

TuringJest avatar TuringJest commented on July 18, 2024

I have the same problem on a Mac M1 :(
Installed tesseract with brew but get the same error
tesseract/tess.cpp:1:10: fatal error: 'tesseract/baseapi.h' file not found

Removing/reinstalling tesseract and leptonica with brew also didn't help.

Leptonica is available under /opt/homebrew/cellar/leptonica. I also tried to set the
PKG_CONFIG_PATH=:/opt/homebrew/cellar/leptonica/leptonica/1.81.1/lib/pkgconfig:/opt/homebrew/cellar/tesseract/4.1.1/lib/pkgconfig

But still nothing...

@wozuo how did you get it to work. Did you just export CPATH and LIBRARY_PATH? I tried that and it also didn't work.

from gosseract.

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.