Articles

Affichage des articles du février, 2018

Anaconda software prevents xml2 package installation: the solution

When trying install xml2 package in terminal, I had an error. The error was caused by anaconda3 software that made a wrong link to the libxml2 library. The solution I found has been to remove anaconda3 install: conda install anaconda-clean anaconda-clean --yes sudo rm -rf /anaconda3 Also, the anaconda-clean --yes command creates a backup in your home directory of the format ~/.anaconda_backup/<timestamp>. Make sure to delete that one also. Then install libxml2 using home-brew : brew install libxml2 and in R install.packages("xml2") You will see something like that: Found pkg-config cflags and libs! Using PKG_CFLAGS=-I/opt/local/include/libxml2 Using PKG_LIBS=-L/opt/local/lib -lxml2 -L/opt/local/lib -lz -L/opt/local/lib -llzma -lpthread -liconv -lm

set JAVA_HOME to correct value in .profile and .Rprofile if you have java jdk

If you have only java jdk installed:  http://www.oracle.com/technetwork/java/javase/downloads/jdk8-downloads-2133151.html Note that if you have jdk (Java development kit) installed, the jre (java runtime environment) is also installed within the jdk. There is no need to install jre separately. In your .profile: export JAVA_HOME=$(/usr/libexec/java_home)/jre Quit and open a new terminal session. And in .Rprofile: if (nchar(Sys.getenv("JAVA_HOME")) < 1) { Sys.setenv(JAVA_HOME = system("echo $(/usr/libexec/java_home)/jre", intern=TRUE)) } Do not forget to use in R: sudo R CMD javareconf