2015-10-19 141 views
10

爲了在Jupyter中使用R,我剛剛安裝了Anaconda的R精華(已將R安裝在我的電腦上)。Jupyter R內核崩潰

現在,當我在Jupyter中打開一個新的R筆記本時,幾秒鐘後(甚至沒有輸入任何內容)內核崩潰並需要重新啓動。

我得到終端上的錯誤是

[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: 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 [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: 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: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

我想這可能與共享庫問題,但我無法弄清楚如何解決它...

回答

0

我有同樣的問題。問題似乎是,Jupyter中的R內核正在尋找具有舊版本ibstdC++。so.6的不同位置。

下面的步驟工作對我來說(以root身份登錄,因爲R和蟒蛇是一個安裝根):

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

說明:

[[email protected] ~]# 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 
[[email protected] ~]# 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 

我們可以看到,/ lib64目錄/的libstdC++。 so.6指向舊的版本比/usr/local/lib64/libstdc++.so.6

[[email protected] ~]# 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 
[[email protected] ~]# 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 

所以,我複製了所有libstd ++ FIL es從/ usr/local/lib64升級到/ lib64,然後將軟鏈接更改爲指向新版本。