Python: Camelot-PY (Error: GhostscriptNotFound while it is installed) for M1 MacOS - apple-m1

Problems using Camelot-py for PDF parsing. Cannot locate 'gs' package, although it has been installed in any imaginable way... Using M1 Monterey OS.
While GS is clearly installed (gs launches from Terminal root just fine), home-brew installation of python / Xcode, PATH variables added through 'export PATH'. Still getting the same error with Ghostscript not being installed when trying to parse a PDF table.
Any suggestions / experience on this please? One would have thought it should not be such a massive pain to resolve...

I had the same issue, which was resolved by installing camelot-py from Anaconda:
conda install -c conda-forge camelot-py

Related

Failed to install any R packages in my conda virtual environment

I got my new computer (Mac Pro M1) lately but I am not quite familiar with the MacOS system...
I enjoy using VSCode so I configured it with R language. I created an virtual environment with commands:
conda create -n R python=3.8
conda activate R
conda install -c conda-forge r-base=4.1.2
conda install -c conda-forge r-languageserver
and configured everything following this website. Everything goes fine when I run R language except for installing R packages. Here is a screenshot of my problem.
I can only install packages on R.app:
Can anyone help me? Thanks so much in advance!!!
I really want to get everything ready for coding in R language with VSCode!!! How to solve it? It seems not a problem of permission?
Updated infomation here:
Below are some screenshots showing what are in my R conda environment:
Also, the paths of R and Radian are added to settings of VSCode:

libtinfow.so.6: cannot open shared object file: No such file or directory

Conda was used to install R in my centos 7 sysytem. conda install r
the version of installed r is r-3.4.1.
However, when I use r, there have a error output. "/usr/local/bin/miniconda3/lib64/R/bin/exec/R: error while loading shared libraries: libtinfow.so.6: cannot open shared object file: No such file or directory"
Some tests have been used according to search by google use the keyword "libtinfow.so.6".
Only two information can be found. They have no help to me.
enter image description here
I had the same problem on a recent centos installation. But I think this has nothing to do with centos, but rather to misconfiguration related to different R packages version. To solve the problem, I just uninstall all the R related packages and gxx and gcc packages using "conda uninstall ". Than I installed R using "conda install -c r r", which force to install gcc and gxx within the same process.

R can't install devtools or git2r due to lack of zlib on macOS 10.12.3 and 10.12.5

I am trying to install two packages in R (3.3.2): devtools and git2r. They are depending on the existence of zlib. This comes with macOS Sierra (10.12.3) and it's version 1.2.8 by default.
When I'm trying to install these packages I get the error below.
I've been trying a lot of things.
directly installing via CRAN in RStudio: no effect.
trying to locate zlib on macOS: can't find zlib.
installing via R CMD INSTALL git2r: no effect.
I notice someone has a similar issue posted on GitHub: https://github.com/ropensci/git2r/issues. There is no solution yet.
Does anyone here have an idea?
Thanks!
Sander
ERROR MESSAGE BELOW
configure error in "/private/tmp/RtmpP6HZFx/R.INSTALLe73412909267/git2r"
configure error
The zlib library that is required to build git2r was not found.
Please install:
zlib1g-dev (package on e.g. Debian and Ubuntu)
zlib-devel (package on e.g. Fedora, CentOS and RHEL)
and try again.
If the zlib library is installed on your system but the git2r configuration is unable to find it, you can specify the include and lib path to zlib with:
"R CMD INSTALL --configure-args='--with-zlib-include=INCLUDE_PATH --with-zlib-lib=LIB_PATH' git2r"
See "config.log" for more details
ERROR: configuration failed for package "git2r"
*removing "/usr/local/lib/R/3.3/site-library/git2r"
UPDATE: the same issue persists on macOS X 10.12.5 in combination with R 3.4.0 - the latter I need for DESeq2.
Solution...Mmm. Not really. I simply uninstalled R and all the packages, and than I reinstalled everything again. I installed R and RStudio via homebrew, following the instructions here: https://rud.is/b/2015/10/22/installing-r-on-os-x-100-homebrew-edition/.
Oddly enough: all issues disappeared.
UPDATE #1: this solution does not - obviously - work for the combination R 3.4.0 and macOS X 10.12.5. We need a solution for this issue.
UPDATE #2: I have discovered what I believe was the issue: a wrong path to the xcode command line tools.
sudo xcode-select --reset did the trick and now xcode-select -p points to /Library/Developer/CommandLineTools. And which xcode-select points to /usr/bin/xcode-select. Googling I discovered that it is not needed to install Xcode through the App Store as it states on http://railsapps.github.io/xcode-command-line-tools.html:
"On earlier versions of macOS, it was more difficult to install Xcode Command Line Tools. It required a huge download of the full Xcode package from the Mac App Store or registration as an Apple developer for a smaller Command Line Tools package. Mac OS X Mavericks made installation of Xcode Command Line Tools much simpler.".
i was having the same problem. i have a note 8(samsung). just go to GitHub and install zlib from there.

R cmd check not locating texi2pdf on mac after R 3.1.3 upgrade

Does anyone have a link to clear instructions on how to install and configure the necessary latex packages to build R packages on a mac?
I have some scripts for building and checking R packages on a mac server. They seemed to work fine, but after upgrading to R 3.1.3, many of the packages started failing with
Error in texi2dvi(file = file, pdf = TRUE, clean = clean, quiet = quiet, :
Running 'texi2dvi' on 'networkVignette.tex' failed.
Messages:
sh: /usr/local/bin/texi2dvi: No such file or directory
Calls: <Anonymous> -> texi2pdf -> texi2dvi
Execution halted
I found a thread which seemed to suggest I need a more recent version texinfo (5.2) than what is installed by default. And apparently I've I've got the wrong version installed in the wrong location?
which texi2pdf
/sw/bin/texi2pdf
texi2pdf --version
texi2pdf (GNU Texinfo 5.1) 5234
(same version is reported when running system('texi2pdf --version') in R )
This thread gives a link to a texinfo 5.2 source collection:
http://r.789695.n4.nabble.com/R-CMD-build-looking-for-texi2dvi-in-the-wrong-place-R-devel-td4701706.html
But I'm not familiar with installing executable from a tar.gz file on a mac. The R mac help pages I found suggest installing MacTex, which I tried but that didn't seem to help.
** Update: ** additional discussion of related problems on R-SIG-mac mailing list:
https://groups.google.com/forum/#!topic/r-sig-mac/xjyuFdl5Ezk
Update:
Here is where I'm currently at:
I removed my /sw directory to uninstall fink and all of its packages (couldn't figure out how to upgrade it)
installed homebrew
brew install texinfo installs version 5.2 the package,
but generates the message This formula is keg-only, which means it was not symlinked into /usr/local and actually installs in in /usr/local/Cellar/texinfo/5.2/bin which means it is not on the path and R won't find it.
manually symlink each of the texi2pdf, texi2dvi , etc as vincent suggests (this is because R has the /usr/local/bin location as default in the tools::texi2dvi function?
edited the /etc/paths file on the system to add /usr/local/bin so that finds the brew installed 5.2 version before it finds it before the osx system supplied version 4.6 version. This may not be necessary because R has it hardcoded?
All of this gets rid of the "can't find texi* errors", and gives me a bunch of latex errors (which I don't see on unix and windows builds) so I'm still kind of stuck.
This seems very hackish, so there must be a cleaner way? But it sounds like stuff with tex and mac is very sketchy at the moment? https://tex.stackexchange.com/questions/208181/why-did-my-tex-related-gui-program-stop-working-in-mac-os-x-yosemite
This worked for me on Mavericks and on Yosemite:
ln -s /usr/bin/texi2dvi /usr/local/bin/texi2dvi
ln -s /usr/bin/texi2pdf /usr/local/bin/texi2pdf
On my Lion system both the command which texi2pdf at a Terminal/bash prompt and from a R.app GUI prompt tell me that I have that program in:
system("which texi2pdf")
#/opt/local/bin/texi2pdf
That is a location typical for MacPorts installation. I think the /usr/local/bin/ is what the binary R version "expects". I'm not really that UNIX savvy, but I think the you can modify the PATH environment variable so that R will be able to find your installation. (Whether it will be compatible I cannot say since so much detail is missing from your question.) My Tex installation is MacTex, which I got from https://www.tug.org/mactex/. I admit to having a cobbled-together system:
system("echo $PATH")
# /opt/local/bin:/opt/local/sbin:/sw/bin:/sw/sbin:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin:/usr/texbin:/usr/X11/bin:/usr/X11R6/bin
That gets set at the beginning of an R session because this is the first line in my .Rprofile-(invisible)file:
Sys.setenv(PATH="/opt/local/bin:/opt/local/sbin:/sw/bin:/sw/sbin:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin:/usr/texbin:/usr/X11/bin:/usr/X11R6/bin")
I think /sw/bin/ installations signify a fink install, which I have had very little success with. Simon Urbanek suggests not using any package installers, but then leaves the rest of us UNIX weenies very little in the way of worked examples of how to install that various external packages that underpin the many interesting and oh-so-useful R packages. So I feel your pain, but I'm not running for President.
So I suppose you could try this at your R console before again attempting one of the earlier unsuccessful installs:
Sys.setenv(PATH=paste( Sys.getenv()$PATH, # should be the character string of the $PATH
"/sw/bin/", sep=":")
)
Wish I could offer guarantees, but if it breaks the only guarantee is that you get to keep all the pieces.
I ran into a similar error message using Mavericks 10.9.5 (factory configured) and R 3.1.
It turns out that I didn't have pdfLaTex. I went to this page: http://tug.org/mactex/ and downloaded the MacTex installation package. It's big (>2GB) but after I installed it, my R package build problems went away.
Hope this might be helpful to anyone else who runs into this error message.

Running Rattle on Mac OS X 10.9 (Mavericks)

After installing Mavericks on my Mac, I'm not able to run Rattle anymore.
Because of compatibility issues between RStudio and 10.9 (http://www.r-bloggers.com/rstudio-and-os-x-10-9-mavericks/), I installed v 0.98.433 of RStudio and R 3.0.2
Tried to launch Rattle the normal way: none.
I tried in a different way:
I manually launched xQuartz to install GTK+
via R-Studio I installed RGtg2 and Cairo
Installed Rattle, launched it and I got 1 sec message from Rattle, before it disappeared, crashing R session.
I then tried going back to R 2.15.3 (using RSwitch), doing same procedure.
Rattle starts with no ricognizable character and a bunch of related error messages on the RStudio console, from Pango.
Problem is it is looking for a directory .../pango/1.6.0 that does not exist (I have /1.8.0).
Is there any one who came out with a working combination of R/RStudio/Rattle on Mavericks?
I have a course I'm going to teach on data mining next semester and I introduced Rattle as the core tool, but I need it running.
Going back to previous Mac OS is not an option, because students may have the latest version.
Any help would be highly appreciated
I believe that the problem is with the GTK2 and Cairo modules. After building a few packages from source, rattle works for me...
I have had difficulties with Cairo/GTK2 since Mountain Lion. I got crashes using Simon's binary packages for these. Note that I updated my system to Mavericks, so I have not tried this on a clean install... I also have Homebrew installed for building programs from source. I use the ATT binary installer for R (thanks, Simon) for most packages but build a few packages from source. There were some hiccups and I spent a lot of time searching with Google. Here is what I did:
One needs XCode and the Xcode command line tools installed. After you install XCode, you need to run
sudo xcode-select --install
to install the command line tools. Then install Homebrew according to directions from the web site... Install gtk+ and cairo with their dependencies with:
brew install gtk+ cairo
And wait quite a while for everything to build....
The first problem I had is that I couldn't build any R packages from source because of this error:
make: llvm-gcc-4.2: No such file or directory
Google to the rescue...
I needed to change two lines in Makeconf in /Library/Frameworks/R.framework/Resources/etc to
CC=clang
CXX=clang++
Note: the R Mac Tools page now says this should be:
CC=/usr/local/clang4/bin/clang
CXX=/usr/local/clang4/bin/clang++
LDFLAGS=-L/usr/local/clang4/lib
Then download the source packages for RGtk2, Cairo, and cairoDevice. I do all the work in my ~/bld directory with:
cd ~/bld
export PKG_CONFIG_PATH=/opt/X11/lib/pkgconfig:/Library/Frameworks/GTK+.framework/Versions/Current/Resources/lib/pkgconfig:$PKG_CONFIG_PATH
R CMD install RGtk2_2.20.25.tar.gz
R CMD install Cairo_1.5-2.tar.gz
R CMD install cairoDevice_2.19.tar.gz
Hope this helps.

Resources