11
votes

I have just installed the R essentials from Anaconda (having R already installed on my computer) in order to use R in Jupyter.

Now, when I open a new R notebook in Jupyter, after few seconds (without even typing anything) the kernel crashes and needs to be restarted.

The error I get on the terminal is

[I 12:30:36.297 NotebookApp] Kernel started: dd5dd612-2c8f-4235-9619-1cf5a46b3e89

IRkernel::main() Error in dyn.load(file, DLLpath = DLLpath, ...) : unable to load shared object '/home/alberto/R/x86_64-pc-linux-gnu-library/3.2/stringi/libs/stringi.so': /home/alberto/anaconda3/lib/R/library/rzmq/libs/../../../../libstdc++.so.6: version CXXABI_1.3.8' not found (required by /home/alberto/R/x86_64-pc-linux-gnu-library/3.2/stringi/libs/stringi.so) Calls: :: ... tryCatch -> tryCatchList -> tryCatchOne -> <Anonymous> Execution halted [I 12:30:39.299 NotebookApp] KernelRestarter: restarting kernel (1/5) IRkernel::main() Error in dyn.load(file, DLLpath = DLLpath, ...) : unable to load shared object '/home/alberto/R/x86_64-pc-linux-gnu-library/3.2/stringi/libs/stringi.so': /home/alberto/anaconda3/lib/R/library/rzmq/libs/../../../../libstdc++.so.6: versionCXXABI_1.3.8' not found (required by /home/alberto/R/x86_64-pc-linux-gnu-library/3.2/stringi/libs/stringi.so) Calls: :: ... tryCatch -> tryCatchList -> tryCatchOne -> Execution halted [I 12:30:42.309 NotebookApp] KernelRestarter: restarting kernel (2/5) IRkernel::main() Error in dyn.load(file, DLLpath = DLLpath, ...) : unable to load shared object '/home/alberto/R/x86_64-pc-linux-gnu-library/3.2/stringi/libs/stringi.so': /home/alberto/anaconda3/lib/R/library/rzmq/libs/../../../../libstdc++.so.6: version CXXABI_1.3.8' not found (required by /home/alberto/R/x86_64-pc-linux-gnu-library/3.2/stringi/libs/stringi.so) Calls: :: ... tryCatch -> tryCatchList -> tryCatchOne -> <Anonymous> Execution halted [I 12:30:45.315 NotebookApp] KernelRestarter: restarting kernel (3/5) IRkernel::main() Error in dyn.load(file, DLLpath = DLLpath, ...) : unable to load shared object '/home/alberto/R/x86_64-pc-linux-gnu-library/3.2/stringi/libs/stringi.so': /home/alberto/anaconda3/lib/R/library/rzmq/libs/../../../../libstdc++.so.6: versionCXXABI_1.3.8' not found (required by /home/alberto/R/x86_64-pc-linux-gnu-library/3.2/stringi/libs/stringi.so) Calls: :: ... tryCatch -> tryCatchList -> tryCatchOne -> Execution halted [W 12:30:46.485 NotebookApp] Timeout waiting for kernel_info reply from dd5dd612-2c8f-4235-9619-1cf5a46b3e89 [I 12:30:48.322 NotebookApp] KernelRestarter: restarting kernel (4/5) WARNING:root:kernel dd5dd612-2c8f-4235-9619-1cf5a46b3e89 restarted IRkernel::main() Error in dyn.load(file, DLLpath = DLLpath, ...) : unable to load shared object '/home/alberto/R/x86_64-pc-linux-gnu-library/3.2/stringi/libs/stringi.so': /home/alberto/anaconda3/lib/R/library/rzmq/libs/../../../../libstdc++.so.6: version `CXXABI_1.3.8' not found (required by /home/alberto/R/x86_64-pc-linux-gnu-library/3.2/stringi/libs/stringi.so) Calls: :: ... tryCatch -> tryCatchList -> tryCatchOne -> Execution halted [W 12:30:51.329 NotebookApp] KernelRestarter: restart failed [W 12:30:51.329 NotebookApp] Kernel dd5dd612-2c8f-4235-9619-1cf5a46b3e89 died, removing from map. ERROR:root:kernel dd5dd612-2c8f-4235-9619-1cf5a46b3e89 restarted failed! [W 12:30:51.361 NotebookApp] Kernel deleted before session

I guess it might be a problem with shared libraries but I can't figure out how to solve it...

2

2 Answers

3
votes

(TEMP FIX ONLY)

See this discussion: https://groups.google.com/a/continuum.io/forum/#!topic/conda/nqPfPGYP--g

I was able to get my kernel running using the suggested temporary fix:

$ conda remove gcc libgcc

0
votes

I had the same problem. The issue seems to be that the R kernel in Jupyter was looking at a different location which had an older version of ibstdc++.so.6.

Below steps worked for me (logged in as root, since R and python were installed as root):

cp -fv /usr/local/lib64/libstdc++* /lib64/
cd /lib64
ln -sfT libstdc++.so.6.0.21 libstdc++.so.6

Explanation:

[root@SERVER ~]# strings /usr/local/lib64/libstdc++.so.6 | grep CXXABI_1.3
CXXABI_1.3
CXXABI_1.3.1
CXXABI_1.3.2
CXXABI_1.3.3
CXXABI_1.3.4
CXXABI_1.3.5
CXXABI_1.3.6
CXXABI_1.3.7
CXXABI_1.3.8
CXXABI_1.3.9
CXXABI_1.3
CXXABI_1.3.2
CXXABI_1.3.6
CXXABI_1.3.9
CXXABI_1.3.1
CXXABI_1.3.5
CXXABI_1.3.8
CXXABI_1.3.4
CXXABI_1.3.7
CXXABI_1.3.3
[root@SERVER ~]# strings /lib64/libstdc++.so.6 | grep CXXABI_1.3
CXXABI_1.3
CXXABI_1.3.1
CXXABI_1.3.2
CXXABI_1.3.3
CXXABI_1.3.4
CXXABI_1.3.5
CXXABI_1.3.6
CXXABI_1.3.7

We can see that /lib64/libstdc++.so.6 points to an older version than /usr/local/lib64/libstdc++.so.6

[root@SERVER ~]# ls /lib64/libstdc++.so.* -lrt
-rwxr-xr-x 1 root root   830776 Mar  5  2015 /lib64/libstdc++.so.5.0.7
lrwxrwxrwx 1 root root       18 Apr 29  2016 /lib64/libstdc++.so.5 -> libstdc++.so.5.0.7
lrwxrwxrwx 1 root root       19 Jan 27 01:46 /lib64/libstdc++.so.6 -> libstdc++.so.6.0.19
-rwxr-xr-x 1 root root 11103508 Feb  3 21:41 /lib64/libstdc++.so.6.0.19
-rwxr-xr-x 1 root root 11103508 Feb  3 21:41 /lib64/libstdc++.so.6.0.21
-rw-r--r-- 1 root root     2397 Feb  3 21:41 /lib64/libstdc++.so.6.0.21-gdb.py
[root@SERVER ~]# ls /usr/local/lib64/libstdc++* -lrt
-rwxr-xr-x 1 root root      905 Jun 15  2016 /usr/local/lib64/libstdc++fs.la
-rw-r--r-- 1 root root 10964026 Jun 15  2016 /usr/local/lib64/libstdc++fs.a
-rwxr-xr-x 1 root root 11103508 Jun 15  2016 /usr/local/lib64/libstdc++.so.6.0.21
lrwxrwxrwx 1 root root       19 Jun 15  2016 /usr/local/lib64/libstdc++.so.6 -> libstdc++.so.6.0.21
lrwxrwxrwx 1 root root       19 Jun 15  2016 /usr/local/lib64/libstdc++.so -> libstdc++.so.6.0.21
-rwxr-xr-x 1 root root      965 Jun 15  2016 /usr/local/lib64/libstdc++.la
-rw-r--r-- 1 root root 28847974 Jun 15  2016 /usr/local/lib64/libstdc++.a

So, I copied all libstd++ files from /usr/local/lib64 to /lib64 and then changed the soft link to point to the new version.