Closed DZGodly closed 8 months ago
gosseract version?
I have the same issue on masOS Sonoma.
gosseract version 2.2.1
Installing github.com/otiai10/gosseract/v2
, I got this error:
main.go:6:2: no required module provides package github.com/otiai10/gosseract; to add it:
go get github.com/otiai10/gosseract
After running go get github.com/otiai10/gosseract
I have this on my go.mod
require (
github.com/otiai10/gosseract v2.2.1+incompatible // indirect
github.com/otiai10/gosseract/v2 v2.4.1 // indirect
)
Then running my project Im getting...
/usr/local/go/pkg/tool/darwin_arm64/link: running clang++ failed: exit status 1
ld: warning: ignoring duplicate libraries: '-llept', '-ltesseract'
ld: library 'lept' not found
clang: error: linker command failed with exit code 1 (use -v to see invocation)
Go Env
GO111MODULE=''
GOARCH='arm64'
GOBIN=''
GOCACHE='/Users/roger/Library/Caches/go-build'
GOENV='/Users/roger/Library/Application Support/go/env'
GOEXE=''
GOEXPERIMENT=''
GOFLAGS=''
GOHOSTARCH='arm64'
GOHOSTOS='darwin'
GOINSECURE=''
GOMODCACHE='/Users/roger/go/pkg/mod'
GONOPROXY=''
GONOSUMDB=''
GOOS='darwin'
GOPATH='/Users/roger/go'
GOPRIVATE=''
GOPROXY='https://proxy.golang.org,direct'
GOROOT='/usr/local/go'
GOSUMDB='sum.golang.org'
GOTMPDIR=''
GOTOOLCHAIN='auto'
GOTOOLDIR='/usr/local/go/pkg/tool/darwin_arm64'
GOVCS=''
GOVERSION='go1.22.0'
GCCGO='gccgo'
AR='ar'
CC='clang'
CXX='clang++'
CGO_ENABLED='1'
GOMOD='/Users/roger/Workspace/app/ocr/go.mod'
GOWORK=''
CGO_CFLAGS='-O2 -g'
CGO_CPPFLAGS=''
CGO_CXXFLAGS='-O2 -g'
CGO_FFLAGS='-O2 -g'
CGO_LDFLAGS='-O2 -g'
PKG_CONFIG='pkg-config'
GOGCCFLAGS='-fPIC -arch arm64 -pthread -fno-caret-diagnostics -Qunused-arguments -fmessage-length=0 -ffile-prefix-map=/var/folders/yt/z5kdx8690gvbl67tmvc_4_2m0000gn/T/go-build3343530240=/tmp/go-build -gno-record-gcc-switches -fno-common'
tesseract --version
tesseract 5.3.4
leptonica-1.84.1
libgif 5.2.1 : libjpeg 8d (libjpeg-turbo 3.0.0) : libpng 1.6.43 : libtiff 4.6.0 : zlib 1.2.12 : libwebp 1.3.2 : libopenjp2 2.5.2
Found NEON
Found libarchive 3.7.2 zlib/1.2.12 liblzma/5.4.4 bz2lib/1.0.8 liblz4/1.9.4 libzstd/1.5.5
Found libcurl/8.1.2 SecureTransport (LibreSSL/3.3.6) zlib/1.2.12 nghttp2/1.55.1
It turned out I was importing the old library on my project
import (
"github.com/otiai10/gosseract"
)
After changing to v2, everything compile fine.
import (
"github.com/otiai10/gosseract/v2"
)
I encountered the same problem as in issue #248 , however the solutions mentioned in it don't work for me.
environment