ERROR: configuration failed for package ‘stringi’,conda安裝解決

如何在無(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ò),安裝成功!

參考文章:
https://stackoverflow.com/questions/31942322/how-to-install-stringi-from-local-file-absolutely-no-internet-access

?著作權(quán)歸作者所有,轉(zhuǎn)載或內(nèi)容合作請(qǐng)聯(lián)系作者
【社區(qū)內(nèi)容提示】社區(qū)部分內(nèi)容疑似由AI輔助生成,瀏覽時(shí)請(qǐng)結(jié)合常識(shí)與多方信息審慎甄別。
平臺(tái)聲明:文章內(nèi)容(如有圖片或視頻亦包括在內(nèi))由作者上傳并發(fā)布,文章內(nèi)容僅代表作者本人觀點(diǎn),簡(jiǎn)書(shū)系信息發(fā)布平臺(tái),僅提供信息存儲(chǔ)服務(wù)。

相關(guān)閱讀更多精彩內(nèi)容

友情鏈接更多精彩內(nèi)容