安装路径不可写R,无法更新软件包 [英] installation path not writable R, unable to update packages

查看:3403
本文介绍了安装路径不可写R,无法更新软件包的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试使用其网站上的代码将Bioconductor安装到R中.当我键入代码时(请参见下面的内容),我收到一条错误消息,提示某些软件包无法更新,安装路径不可写.

I am trying to install Bioconductor into R, using the code on their website. When I type in the code (see bellow) I get an error message saying that some packages can't be updated, the installation path is unwriteable.

> ## try http:// if https:// URLs are not supported
> source("https://bioconductor.org/biocLite.R")
Bioconductor version 3.4 (BiocInstaller 1.24.0), ?biocLite for help
> biocLite()
BioC_mirror: https://bioconductor.org
Using Bioconductor 3.4 (BiocInstaller 1.24.0), R 3.3.2 (2016-10-31).
installation path not writeable, unable to update packages: Matrix, mgcv,

生存

我可以通过转到软件包/安装软件包来安装这些软件包.

I can install these package by going to packages/install packages.

> utils:::menuInstallPkgs()
trying URL    'https://www.stats.bris.ac.uk/R/bin/windows/contrib/3.3/Matrix_1.2-8.zip'
Content type 'application/zip' length 2775038 bytes (2.6 MB)
downloaded 2.6 MB

trying URL 'https://www.stats.bris.ac.uk/R/bin/windows/contrib/3.3/mgcv_1.8-  16.zip'
Content type 'application/zip' length 2346257 bytes (2.2 MB)
downloaded 2.2 MB

trying URL     'https://www.stats.bris.ac.uk/R/bin/windows/contrib/3.3/survival_2.40-1.zip'
Content type 'application/zip' length 5109948 bytes (4.9 MB)
downloaded 4.9 MB

package ‘Matrix’ successfully unpacked and MD5 sums checked
package ‘mgcv’ successfully unpacked and MD5 sums checked
package ‘survival’ successfully unpacked and MD5 sums checked

The downloaded binary packages are in
    C:\Users\stxeb8\AppData\Local\Temp\Rtmp2tQZ4v\downloaded_packages

然后我可以转到包/加载包并成功加载它们,然后搜索并查看其中的包.

I can then go to packages/ load packages and load them succesfully and search and see that the packages are there.

> local({pkg <- select.list(sort(.packages(all.available =   TRUE)),graphics=TRUE)
+ if(nchar(pkg)) library(pkg, character.only=TRUE)})
Loading required package: nlme
This is mgcv 1.8-16. For overview type 'help("mgcv-package")'.
> local({pkg <- select.list(sort(.packages(all.available = TRUE)),graphics=TRUE)
+ if(nchar(pkg)) library(pkg, character.only=TRUE)})
> local({pkg <- select.list(sort(.packages(all.available = TRUE)),graphics=TRUE)
+ if(nchar(pkg)) library(pkg, character.only=TRUE)})
> local({pkg <- select.list(sort(.packages(all.available =     TRUE)),graphics=TRUE)
+ if(nchar(pkg)) library(pkg, character.only=TRUE)})
> search()
[1] ".GlobalEnv"            "package:survival"      "package:mgcv"         
[4] "package:nlme"          "package:Matrix"        "package:BiocInstaller"
[7] "package:stats"         "package:graphics"      "package:grDevices"    
[10] "package:utils"         "package:datasets"      "package:methods"      
[13] "Autoloads"             "package:base"         

但是当我去安装bioconductor时,它会给我同样的错误消息,即无法更新Matrix,mgcv和存活率.

But then when I go to install bioconductor it gives me the same error message that Matrix, mgcv and survival aren't able to be updated.

> ## try http:// if https:// URLs are not supported
> source("https://bioconductor.org/biocLite.R")
Bioconductor version 3.4 (BiocInstaller 1.24.0), ?biocLite for help
> biocLite()
BioC_mirror: https://bioconductor.org
Using Bioconductor 3.4 (BiocInstaller 1.24.0), R 3.3.2 (2016-10-31).
installation path not writeable, unable to update packages: Matrix, mgcv,
  survival

我该怎么做才能更新这些软件包,以便安装生物导体?

What can I do to be able to update these packages so I can install bioconductor?

推荐答案

对我来说,这是一个权限问题.首先,我使用installed.packages()[, c("Package", "LibPath")]确定了软件包的安装位置.这将输出一个长2列的矩阵,其中包含软件包的名称和位置.然后,您将看到有问题的软件包在哪里.就我而言,它们位于/usr/lib/R/site-library/usr/lib/R/library.然后我用chmod更改了这些文件夹的权限(我在主R文件夹上使用了chmod -R 777,这是我的个人计算机,因此我认为这里的安全性不是什么大问题).

It was a permission issue for me. First, I identified where the packages were installed using installed.packages()[, c("Package", "LibPath")]. This outputs a long 2 column matrix with the names and locations of the packages. Then you will see where the offending packages are. In my case, they were at /usr/lib/R/site-library and /usr/lib/R/library. Then I changed the permission of these folders by chmod (I used chmod -R 777 on the main R folder, this is my personal computer, so security is not a big concern here I think).

这篇关于安装路径不可写R,无法更新软件包的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆