[英]Package ‘stringr’ was installed before R 4.0.0: please re-install it BiocManager Installation path not writeable, unable to update packages
Got the errors Error: package 'stringr' was installed before R 4.0.0: please re-install it
and B iocManager Installation path not writeable, unable to update packages:
得到错误
Error: package 'stringr' was installed before R 4.0.0: please re-install it
and B iocManager Installation path not writeable, unable to update packages:
and further down the road rstudio gave me再往前走 rstudio 给了我
/usr/local/lib/R/lib/libR.so not found
I had a similar problem when upgrading from R 3.6 to 4.0 in my Linux box.在我的 Linux 盒子中从 R 3.6 升级到 4.0 时,我遇到了类似的问题。 I am also answering this because this question is one of the first results google gives when looking for this problem.
我也在回答这个问题,因为这个问题是谷歌在寻找这个问题时给出的第一个结果之一。 It turns out that, even by removing R (apt purge) there is a folder that remains in the system creating a lot of problems for the future installation.
事实证明,即使删除了 R (apt purge),系统中仍然存在一个文件夹,为将来的安装带来了很多问题。 I want to link the GREAT answer that was given here and saved me: https://askubuntu.com/questions/1219737/installing-ggplot2-for-r-3-6-on-ubuntu-18-04
我想链接这里给出的伟大答案并救了我: https://askubuntu.com/questions/1219737/installing-ggplot2-for-r-3-6-on-ubuntu-18-04
In Linux systems you should look in:在 Linux 系统中,您应该查看:
$ ls /usr/local/lib/R/site-library
If the folder has a list of directories you should remove everything with:如果该文件夹有一个目录列表,您应该删除所有内容:
sudo rm -Rf /usr/local/lib/R/site-library
Then reinstall R and all the libraries.然后重新安装 R 和所有库。
This is a long answer to how to fix these errors but I assume necessary and also tips and tricks included (eg don't install R 4.0.2 right now (Jul 25, 2020)).这是关于如何修复这些错误的一个很长的答案,但我认为这是必要的,还包括提示和技巧(例如,现在(2020 年 7 月 25 日)不要安装 R 4.0.2)。 It caused me a lot of pain because there were many more errors that I ran into on the way.
这给我带来了很大的痛苦,因为我在途中遇到了更多的错误。
Error: package 'stringr' was installed before R 4.0.0: please re-install it
and B iocManager Installation path not writeable, unable to update packages:
Error: package 'stringr' was installed before R 4.0.0: please re-install it
和 B iocManager Installation path not writeable, unable to update packages:
I removed.RData in my home folder (invisible, use ls -la
) This fixed my problem for the installed before R 4.0.0 error, but did not fix my bioconductor problems.我在我的主文件夹中删除了.RData(不可见,使用
ls -la
)这解决了我在 R 4.0.0 错误之前安装的问题,但没有解决我的生物导体问题。 I assume it might work if you only had the re-install error.我认为如果您只有重新安装错误,它可能会起作用。
After many attempts at trying to get my packages to load but only getting these errors, I opted to reinstall R.经过多次尝试让我的包加载但只收到这些错误后,我选择重新安装 R。 In R, I ran
.libpaths
and deleted all the files in each of the directories.在 R 中,我运行了
.libpaths
并删除了每个目录中的所有文件。 I then reinstalled R by downloading R from https://www.r-project.org/ and ran the general compile commands in the downloaded folder ./configure --enable-R-shlib --with-blas --with-lapack
make
sudo make install
.然后我通过从https://www.r-project.org/下载 R 重新安装了 R 并在下载的文件夹
./configure --enable-R-shlib --with-blas --with-lapack
中运行了通用的编译命令。 make
sudo make install
。 The --enable-R-shlib is needed for rstudio to be able to use R, but the others aren't. rstudio 需要 --enable-R-shlib 才能使用 R,但其他则不需要。
On Jul 25, 2020 I tried to install from apt on ubuntu, but rstudio was not able to find libR.so (error of /usr/local/lib/R/lib/libR.so not found
). 2020 年 7 月 25 日,我尝试从 ubuntu 上的 apt 安装,但 rstudio 无法找到 libR.so(
/usr/local/lib/R/lib/libR.so not found
的错误)。 I tried to compile from source R 4.0.2 with the ./configure --enable-R-shlib
which should make the libR.so but this returned an error.我尝试使用
./configure --enable-R-shlib
从源代码 R 4.0.2 进行编译,这应该会生成 libR.so,但这会返回错误。
I assume this to be an underlying problem as running ./configure --enable-R-shlib
compile from source with R 4.0.0, I got the files and Rstudio opened up (please fix R 4.0.2 and subsequently apt). I assume this to be an underlying problem as running
./configure --enable-R-shlib
compile from source with R 4.0.0, I got the files and Rstudio opened up (please fix R 4.0.2 and subsequently apt).
I then ran the general然后我跑了将军
if (!requireNamespace("BiocManager", quietly = TRUE))
install.packages("BiocManager")
BiocManager::install(version = "3.11")
to install biocmanager and it finally worked.安装 biocmanager,它终于奏效了。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.