Not able to install tesseract package

Hi,

I am unable to install tesseract package in rstudio. I get the following error message.

install.packages("tesseract")
Installing package into ‘/home/rstudio-user/R/x86_64-pc-linux-gnu-library/3.5’
(as ‘lib’ is unspecified)
trying URL 'http://package-proxy/src/contrib/tesseract_4.0.tar.gz'
Content type 'application/x-gzip' length 444566 bytes (434 KB)
==================================================
downloaded 434 KB

  • installing source package ‘tesseract’ ...
    ** package ‘tesseract’ successfully unpacked and MD5 sums checked
    Package tesseract was not found in the pkg-config search path.
    Perhaps you should add the directory containing `tesseract.pc'
    to the PKG_CONFIG_PATH environment variable
    No package 'tesseract' found
    Using PKG_CFLAGS=-I/usr/include/tesseract -I/usr/include/leptonica
    Using PKG_LIBS=-ltesseract
    Using CXX11CPP: g++ -E -std=gnu++11
    ------------------------- ANTICONF ERROR ---------------------------
    Configuration failed because tesseract was not found. Try installing:
  • deb: libtesseract-dev libleptonica-dev (Debian, Ubuntu, etc)
  • rpm: tesseract-devel leptonica-devel (Fedora, CentOS, RHEL)
  • csw: libtesseract_dev (Solaris)
  • brew: tesseract (Mac OSX)
    If tesseract is already installed, check that 'pkg-config' is in your
    PATH and PKG_CONFIG_PATH contains a tesseract.pc file. If pkg-config
    is unavailable you can set INCLUDE_DIR and LIB_DIR manually via:
    R CMD INSTALL --configure-vars='INCLUDE_DIR=... LIB_DIR=...'

ERROR: configuration failed for package ‘tesseract’

  • removing ‘/home/rstudio-user/R/x86_64-pc-linux-gnu-library/3.5/tesseract’
    Warning in install.packages :
    installation of package ‘tesseract’ had non-zero exit status
    The downloaded source packages are in
    ‘/tmp/Rtmp9jvCDo/downloaded_packages’

Please help.

Thanks,
Priya

The relevant part of your error message is below:

Configuration failed because tesseract was not found. Try installing:
deb: libtesseract-dev libleptonica-dev (Debian, Ubuntu, etc)
rpm: tesseract-devel leptonica-devel (Fedora, CentOS, RHEL)
csw: libtesseract_dev (Solaris)
brew: tesseract (Mac OSX)

Depending on what your system is, you'll need to install one of these libraries outside of R on which tesseract (the R package) depends.

From the home directory and reference to package-proxy, you appear to be using rstudio.cloud.

This came up just the other day in this topic.