我正在尝试用renv::install()安装这个软件包。
正常情况下,我会用
install.packages('stringi', configure.vars='ICUDT_DIR=path/to/icudt61l.zip/')若要指定icudt61l.zip相关性的位置,请执行以下操作。我怎么才能在这里做这件事?
我试图在我的.Rprofile中添加ICUDT_DIR='path/to/icudt61l.zip/',但是它没有工作。
你知道怎么告诉idea在哪里安装stringi吗?
这是我所犯的错误
> renv::install("stringi")
...
Installing stringi [1.6.2] ...
FAILED
Error installing package 'stringi':
===================================
...
** package ‘stringi’ successfully unpacked and MD5 sums checked
** using staged installation
checking for R_HOME... /opt/R/4.0.3/lib/R
checking for R... /opt/R/4.0.3/lib/R/bin/R
...
checking with pkg-config for the system ICU4C... 50.1.2
checking for ICU4C >= 55... no
*** ICU4C 50.1.2 has been detected
*** Minimal requirements, i.e., ICU4C >= 55, are not met
*** Trying with 'standard' fallback flags
checking whether an ICU4C-based project can be built... yes
checking programmatically for sufficient U_ICU_VERSION_MAJOR_NUM... no
*** This version of ICU4C cannot be used.
*** Using the ICU 69 bundle.
checking whether we may compile src/icu69/common/putil.cpp... yes
checking whether we may compile src/icu69/i18n/number_affixutils.cpp... yes
checking whether alignof(std::max_align_t) is available... no
checking whether alignof(::max_align_t) is available... yes
checking whether the ICU data library can be downloaded... downloading the ICU data library (icudt)
output path: icu69/data/icu4c-69_1-data-bin-l.zip
trying URL 'https://raw.githubusercontent.com/gagolews/stringi/master/src/icu69/data/icu4c-69_1-data-bin-l.zip'
Error in download.file(paste(href, fname, sep = ""), icudtzipfname, mode = "wb"): cannot open URL 'https://raw.githubusercontent.com/gagolews/stringi/master/src/icu69/data/icu4c-69_1-data-bin-l.zip'
trying URL 'http://raw.githubusercontent.com/gagolews/stringi/master/src/icu69/data/icu4c-69_1-data-bin-l.zip'
Error in download.file(paste(href, fname, sep = ""), icudtzipfname, mode = "wb"): cannot open URL 'http://raw.githubusercontent.com/gagolews/stringi/master/src/icu69/data/icu4c-69_1-data-bin-l.zip'
icudt download failed
Error: Stopping on error
In addition: Warning messages:
1: In download.file(paste(href, fname, sep = ""), icudtzipfname, mode = "wb") :
URL 'https://raw.githubusercontent.com/gagolews/stringi/master/src/icu69/data/icu4c-69_1-data-bin-l.zip': status was 'Couldn't connect to server'
2: In download.file(paste(href, fname, sep = ""), icudtzipfname, mode = "wb") :
URL 'http://raw.githubusercontent.com/gagolews/stringi/master/src/icu69/data/icu4c-69_1-data-bin-l.zip': status was 'Couldn't connect to server'
Execution halted
*** *********************************************************************
*** stringi cannot be built.
*** Failed to download the ICU data library (icudt). Stopping now.
*** For build environments that have no internet access,
*** see the INSTALL file for a workaround.
*** *********************************************************************
ERROR: configuration failed for package ‘stringi’
* removing ‘/var/projects/iml/GDCFA21N/avertie_test/renv/staging/2/stringi’
Error: install of package 'stringi' failed [error code 1]发布于 2021-06-08 08:15:09
install.packages("stringi", configure.vars="ICUDT_DIR=<icudt_dir>")只需使用此命令,即可从本地加载ICUDT。如果您运行这一切都有错误,在icudt中connect.You应该遵循这个https://raw.githubusercontent.com/gagolews/stringi/master/INSTALL。
就像这样:
ICU数据库和无因特网接入
请注意,如果您选择使用我们的ICU4C包,那么--默认情况下--将从镜像服务器下载ICU数据库。但是,如果您已经下载了适合您的平台(大号/小终端)的icudt*.zip版本,您可能希望通过以下方式安装该软件包:
install.packages("stringi", configure.vars="ICUDT_DIR=<icudt_dir>")此外,如果您在试图安装的机器上没有internet access,请尝试获取包的最新开发版本,因为它是随ICU数据存档一起提供的。您可以通过省略.Rbuildignore文件中的一些相关行来构建一个可分发的源代码包,该包包含所有所需的ICU数据文件(供脱机使用)。下面的命令序列应该可以做到这一点:
wget https://github.com/gagolews/stringi/archive/master.zip -O stringi.zip
unzip stringi.zip
sed -i '/\/icu..\/data/d' stringi-master/.Rbuildignore
R CMD build stringi-master假设包的最新开发版本编号为x.y.z,则在当前工作目录中创建一个名为stringi_x.y.z.tar.gz的文件。现在可以安装包了(源包可以通过scp传播等等)。通过执行:
R CMD INSTALL stringi_x.y.z.tar.gz或者,从R会话中调用:
install.packages("stringi_x.y.z.tar.gz", repos=NULL)https://stackoverflow.com/questions/67590302
复制相似问题