如何在無(wú)法聯(lián)網(wǎng)的情況下用本地文件安裝‘stringi’可以參考https://stackoverflow.com/questions/31942322/how-to-install-stringi-from-local-file-absolutely-no-internet-access
下載| stringi_1.7.6.tar.gz |
上傳到/path/miniconda3/envs/R-4.1.3/lib/R/library
R CMD INSTALL stringi_1.7.6.tar.gz
?報(bào)錯(cuò)①:
ERROR: failed to lock directory ‘/path/miniconda3/envs/R-4.1.3/lib/R/library’ for modifying
Try removing ‘/path/miniconda3/envs/R-4.1.3/lib/R/library/00LOCK-stringi’
出于防止其他安裝過(guò)程干擾和暫存舊版本的目的,R在安裝package時(shí)會(huì)先建立并鎖定一個(gè)叫00LOCK-X的臨時(shí)文件夾。安裝完畢后如果由于某種原因該臨時(shí)文件夾沒(méi)有被刪除的話,下次更新可能會(huì)因?yàn)殒i定失敗而終止。
?解決方案①:
直接刪除00LOCK-stringi
rm -r /path/miniconda3/envs/R-4.1.3/lib/R/library/00LOCK-stringi
再次運(yùn)行R CMD INSTALL stringi_1.7.6.tar.gz
?報(bào)錯(cuò)②:
checking whether the C++ compiler supports the long long type... no
*** *********************************************************************
*** stringi cannot be built with these settings in place.
*** See the INSTALL file for the solutions to the most common problems.
*** Moreover, explore the list of open and closed issues at
*** https://github.com/gagolews/stringi/issues/
*** *********************************************************************
ERROR: configuration failed for package ‘stringi’
我的R版本是4.1.3,gcc版本是9.3.0,不明白為什么報(bào)錯(cuò)......
?解決方案②:
根據(jù)https://github.com/gagolews/stringi/issues/452
https://github.com/gagolews/stringi/issues/452
修改/path/miniconda3/envs/R-4.1.3/lib/R/etc/Makeconf
將CXX = x86_64-conda-linux-gnu-c++ -std=gnu++11
改為
CXX = x86_64-conda-linux-gnu-c++ -std=c++11
tar xf stringi_1.7.6.tar.gz
chmod -R 755 stringi
R CMD INSTALL stringi
?報(bào)錯(cuò)③:
* installing to library ‘/path/miniconda3/envs/R-4.1.3/lib/R/library’
ERROR: cannot install to srcdir for package ‘stringi’
* removing ‘/path/miniconda3/envs/R-4.1.3/lib/R/library/stringi’
?解決方案③:
conda install -c conda-forge r-stringi
library載入stringi沒(méi)有報(bào)錯(cuò),安裝成功!