Unable to install GitHub package in R | A small experience that took a lot of time

written in front

Recently, when installing the R package, I encountered a situation where the package could not be installed, and then I did all kinds of tinkering. Finally, the R environment will also cause itself to collapse. If you encounter the problem that the R language cannot call stats.dll in this situation , you can refer to my previous method to fiddle with it.

Well, this tweet is also to record myself 曲折的, 愤怒的, 难受的's installation process.

Installation encounters the most troublesome error


Various Error, 下载程序包"******"时出问题, 返回值不是0etc.

How to solve

possible problems

The most likely reason for my previous installation is the network problem, emm, this is a real headache.

1. Network problem

What we usually encounter is the inability to access foreign networks. For example github, Bioconductor(sometimes required), etc. Then we only need to open a vpn to basically improve it.

2. The vpn has been turned on, the network can be accessed normally, but the download is still not possible

This is also what happened to me. My GitHub and foreign network access speeds are very fast, but the package still cannot be installed normally. (Solution, said together in point 3)

3. The download package cannot be installed

On the basis of point 1 or 2, you can download the installation package for installation. But the installation package may not be installed successfully, which is very uncomfortable. (PS: It is also possible that the operation of your own installation is incorrect)

solution

1. Open network vpn

2. Keep tinkering

3. Change network


Situations encountered and solutions

Encountered situation: open network vpn, everything can be accessed normally; GitHub installs other people no problem (consulted with the big guy who developed this package); other package installation is no problem (my own R is no problem); download this package and install it locally, but cannot Install (helpless)...


In such a situation, please listen to my advice: don't bother, change the network decisively.


own solution:

It is recommended to try Uncle Y's plan, or the method in the comment area. I heard that you can't install the github package?

1. Solve it the next morning, turn off the computer and go home to sleep.

2. Install the dependent packages first.

After installing in sequence, install the required packages again.

3. Still unable to install and report an error.

trying URL 'https://bioconductor.org/packages/3.16/data/annotation/src/contrib/org.Mm.eg.db_3.16.0.tar.gz'
Content type 'application/gzip' length 79020899 bytes (75.4 MB)
downloaded 16.7 MB

Error in download.file(url, destfile, method, mode = "wb", ...) : 
  download from 'https://bioconductor.org/packages/3.16/data/annotation/src/contrib/org.Mm.eg.db_3.16.0.tar.gz' failed
In addition: Warning messages:
1: In file.copy(savedcopy, lib, recursive = TRUE) :
  problem copying D:\R\R_library\00LOCK\vctrs\libs\x64\vctrs.dll to D:\R\R_library\vctrs\libs\x64\vctrs.dll: Permission denied
2: In file.copy(savedcopy, lib, recursive = TRUE) :
  problem copying D:\R\R_library\00LOCK\rlang\libs\x64\rlang.dll to D:\R\R_library\rlang\libs\x64\rlang.dll: Permission denied
3: In file.copy(savedcopy, lib, recursive = TRUE) :
  problem copying D:\R\R_library\00LOCK\cli\libs\x64\cli.dll to D:\R\R_library\cli\libs\x64\cli.dll: Permission denied
4: In file.copy(savedcopy, lib, recursive = TRUE) :
  problem copying D:\R\R_library\00LOCK\Rcpp\libs\x64\Rcpp.dll to D:\R\R_library\Rcpp\libs\x64\Rcpp.dll: Permission denied
5: In file.copy(savedcopy, lib, recursive = TRUE) :
  problem copying D:\R\R_library\00LOCK\processx\libs\x64\processx.dll to D:\R\R_library\processx\libs\x64\processx.dll: Permission denied
6: In download.file(url, destfile, method, mode = "wb", ...) :
  downloaded length 17548776 != reported length 79020899
7: In download.file(url, destfile, method, mode = "wb", ...) :
  URL 'https://mghp.osn.xsede.org/bir190004-bucket01/archive.bioconductor.org/packages/3.16/data/annotation/src/contrib/org.Mm.eg.db_3.16.0.tar.gz': Timeout of 60 seconds was reached
Warning in download.packages(pkgs, destdir = tmpd, available = available,  :
  下载程序包‘org.Mm.eg.db’时出了问题

If the above error occurs, you can try my solution. 无需直接到此包的网址中下载包(PS: After downloading, the installation also reports an error. This is the situation encountered this time)

directly download the package in this website and install it.

After operation, it can be installed normally

OK!


Tutorial code:

途径一:到GitHub中获得


Previous articles:

1. The most complete WGCNA tutorial (replace the data to get all the results and graphics)


2. Beautiful graphics drawing tutorial

3. Transcriptome Analysis Tutorial

腾讯课堂: https://bioinformatic.ke.qq.com/
CCtalk: https://www.cctalk.com/m/group/90864710

Xiao Du's life letter notes , mainly publish or include bioinformatics tutorials, and R-based analysis and visualization (including data analysis, graph drawing, etc.); share interested literature and learning materials!!

Guess you like

Origin blog.csdn.net/kanghua_du/article/details/131987192