Closed mbojan closed 2 years ago
Probably some issue with your R_LD_LIBRARY_PATH
or LD_LIBRARY_PATH
. Why do you want to build your own poppler and not use the stock version from ubuntu?
The reason is that I believe pdf_text()
given the same PDF was giving me different results on Windows and on Ubuntu. And so I blamed different versions of poppler
.
So this turns out a serious problem for me. I found rstudio/rstudio#9003 which was frivolously closed "by design". I guess for my PDF-disassembling R code to work portably on Linux and Windows I need to either install a recent poppler on Linux or downgrade/freeze the version on Windows. Do you have any suggestions, @jeroen ?
I have added new backports for you in the cran:poppler
PPA. See the instructions here: https://github.com/ropensci/pdftools#installation
This way you should be able to use the same version of poppler as you get in mac/win, without having to build poppler from source.
Hi @jeroen, I have somewhat a similar error but I receive this whenever I try to install pdftools in RStudio.
install.packages("pdftools")
Error message in testing step of installation:
** testing if installed package can be loaded from temporary location Error: package or namespace load failed for ‘pdftools’ in dyn.load(file, DLLpath = DLLpath, ...): unable to load shared object '/home/amirmo/R/x86_64-pc-linux-gnu-library/4.2/00LOCK-pdftools/00new/pdftools/libs/pdftools.so': /home/amirmo/R/x86_64-pc-linux-gnu-library/4.2/00LOCK-pdftools/00new/pdftools/libs/pdftools.so: undefined symbol: _ZNK7poppler7ustring9to_latin1B5cxx11Ev Error: loading failed Execution halted
I'm running this in a container with a RHEL 7 base and I've installed poppler-cpp-devel as you mentioned in the install procedure. Also tried to adjust the LD_LIBRARY_PATH to include the supposed directory where pdftools would be installed but that had no effect.
R-version: R-4.2.2 RStudio Version Info: RStudio 2022.02.3+492 "Prairie Trillium" Release (1db809b8323ba0a87c148d16eb84efe39a8e7785, 2022-05-20) for CentOS 7 Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/119.0.0.0 Safari/537.36
It may be easier for you to install the precompiled binary for centos-7. Try this:
install.packages("https://p3m.dev/cran/__linux__/centos7/latest/src/contrib/pdftools_3.4.0.tar.gz?r_version=4.2&arch=x86_64", repos = NULL)
I've first tried directly from RStudio, I got some SSL errors
> install.packages("https://p3m.dev/cran/__linux__/centos7/latest/src/contrib/pdftools_3.4.0.tar.gz?r_version=4.2&arch=x86_64", repos = NULL) Installing package into ‘/home/amirmo/R/x86_64-pc-linux-gnu-library/4.2’ (as ‘lib’ is unspecified) trying URL 'https://p3m.dev/cran/__linux__/centos7/latest/src/contrib/pdftools_3.4.0.tar.gz?r_version=4.2&arch=x86_64' Warning in install.packages : URL 'https://p3m.dev/cran/__linux__/centos7/latest/src/contrib/pdftools_3.4.0.tar.gz?r_version=4.2&arch=x86_64': status was 'SSL connect error' Error in download.file(p, destfile, method, mode = "wb", ...) : cannot open URL 'https://p3m.dev/cran/__linux__/centos7/latest/src/contrib/pdftools_3.4.0.tar.gz?r_version=4.2&arch=x86_64'
so I tried to manually download the tarball and install it from the tarball. That also does not seem to work
`> install.packages("pdftools_3.4.0.tar.gz")
Installing package into ‘/home/amirmo/R/x86_64-pc-linux-gnu-library/4.2’
(as ‘lib’ is unspecified)
Warning in install.packages :
package ‘pdftools_3.4.0.tar.gz’ is not available for this version of R
A version of this package for your version of R might be available elsewhere, see the ideas at https://cran.r-project.org/doc/manuals/r-patched/R-admin.html#Installing-packages` Not sure if fixing those SSL errors will do it if installing from tarball didn't work either.
You have to add repos=NULL
to install.packages
if you are installing from a file.
Oh yes, you are correct, my mistake! Installation went fine btw.
I'm trying to understand where the problem is in what's below. It may be unrelated to pdftools and
poppler
but I'd appreciate the expertise.I have some R scripts that use pdftools and they need to work on Windows and on Ubuntu 20.04. While on Windows pdftools installs with the most recent version of poppler on Ubuntu I'm limited to 0.86.1 available in the repositories. I try installing the latest release from the sources following the instructions at https://askubuntu.com/a/1112947/58469 . Everything works in the terminal: pdftools installs correctly and I can load the package and use it. However, it does not work in RStudio with the error:
I have no clue why. Any ideas? Is it RStudio? Is it the environment?
Thanks!