Comments (25)
Need to install libleptonica-dev
and libtesseract-dev
.
from gosseract.
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.
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.
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.
on osx, this is solved using homebrew: brew install tesseract
from gosseract.
+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.
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.
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.
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.
I follow this command
brew remove tesseract
brew remove leptonica
xcode-select --install
brew install tesseract
go get github.com/otiai10/gosseractsame error
same here
I have xcode-select installed already
from gosseract.
@martinlindhe @pindamonhangaba
Thanks!
It was a problem caused by updating my machie mavericks to yosemite
from gosseract.
s/It was/It might have been/
from gosseract.
Thanks for comment.
Did you try this?
#40 (comment)
from gosseract.
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.
how about brew uinstall
and install again?
from gosseract.
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.
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.
Thank you! ๐บ
from gosseract.
+1
from gosseract.
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.
did you get any error output while issuing those commands?
from gosseract.
how about on windows?
from gosseract.
@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.
@martinlindhe @pindamonhangaba
Thanks!
from gosseract.
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)
- leptonica HOT 3
- Convert image to pdf HOT 1
- undefined: gosseract.NewClient HOT 15
- fatal error: leptonica/allheaders.h: No such file or directory HOT 2
- Fails to OCR file that CLI Tesseract handles perfectly HOT 2
- tessbridge.cpp:5:10: fatal error: 'leptonica/allheaders.h' file not found HOT 1
- `leptonica` a hundredth time! HOT 7
- does not recognize spaces as another found result
- how can i get Orientation in degrees
- Extracting text is not working correctly in v5.3.0-2 in Alpine
- Mac OS run err:ld: library not found for -lleptonica HOT 3
- build for windows arch fail HOT 1
- Linking and DLL runtime issues on Windows HOT 1
- library not found for -llept HOT 5
- undefined: gosseract.NewClient HOT 3
- ld: library 'leptonica' not found HOT 2
- ะกrashes with concurrency (win11) HOT 2
- [Question] High CPU Usage
- undefined: gosseract.NewClient when CGO_ENABLED=0 HOT 2
- cannot find -lleptonica and -ltesseract 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 gosseract.