Score:0

system dependency of librsvg2-dev at Ubuntu when using R at a conda environment

cn flag

I have a problem with the system dependency of librsvg2-dev at Ubuntu 22.04 when using R at a conda environment

The library librsvg2-dev is already installed and updated, but not recognized as so, when installing an R package.

I am getting the following error at an Ubuntu 22.04, when trying to install rsvg at Rstudio.

--------------------------- [ANTICONF] --------------------------------
Configuration failed to find the librsvg-2.0 library. Try installing:
deb: librsvg2-dev (Debian,Ubuntu, etc) rpm: librsvg2-devel (Fedora,
EPEL) csw: librsvg_dev, sunx11_devel (Solaris) brew: librsvg (OSX) If
librsvg-2.0 is already installed, check that 'pkg-config' is in your
PATH and PKG_CONFIG_PATH contains a librsvg-2.0.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=...'

I have already asked at Stack Overflow, but I believe maybe this is Ubuntu-related, so I am asking here also.

This problem remind of this post, but involving a different context/error message.

The point is:

  1. The library librsvg2-dev is already installed and updated;

  2. From here, I understood how to check this'PKG_CONFIG_PATH'...

  • The pkg-config --libs librsvg-2.0 returns:

-lrsvg-2 -lm -lgio-2.0 -lgdk_pixbuf-2.0 -lgobject-2.0 -lglib-2.0 -lcairo

Which I do not understand completely but sounds ok, as it does not return 'not fond' as in that post.

  • The which pkg-config returns

/usr/bin/pkg-config


I am unable to understand the 'INCLUDE_DIR and LIB_DIR' part of the error message:

If pkg-config is unavailable you can set INCLUDE_DIR and LIB_DIR manually via: R CMD INSTALL --configure-vars='INCLUDE_DIR=... LIB_DIR=...

But I got from the previous outputs pkg-config is available, so, I should not try to install anything by R CMD INSTALL...

So, I assume it is related to environment. The R+RStudio is running with a conda environment. I understand the conda install x sudo apt-get issues, and I should opt for conda install librsvg2-dev as I have a conda environment, but it returns

PackagesNotFoundError: The following packages are not available from current channels:

So, I made a search at anaconda page, and I have installed two apparently related packages:

conda install -c conda-forge r-rsvg
conda install -c conda-forge librsvg

Still without success in installing rsvg...

So, I am started to think this may be Ubuntu related... But I am not an advanced Ubuntu user... and no idea about how to proceed... How can I solve it?

Is it system dependencies related because the conda environment is in use? If so, how to meet system dependencies when a conda environment is used?

Any help is appreciated.

I sit in a Tesla and translated this thread with Ai:

mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.