Help regarding package loading: Error: package or namespace load failed for 'dplyr'

Hello,

I have been having a lot of trouble with loading my libraries in R lately. For instance, I have been getting the recent error messages.

library(dplyr)
Error: package or namespace load failed for ‘dplyr’ in get(Info[i, 1], envir = env):
lazy-load database 'C:/Users/Sterling L. Wright/Documents/R/win-library/3.6/ellipsis/R/ellipsis.rdb' is corrupt
In addition: Warning message:
In get(Info[i, 1], envir = env) : internal error -3 in R_decompress1
normalizePath()
Error in path.expand(path) : argument "path" is missing, with no default

When I run the following commands
.libPaths()
[1] "C:/Users/Sterling L. Wright/Documents/R/win-library/3.6"
[2] "C:/Program Files/R/R-3.6.3/library"

I have tried to reset my .Renviron profile by using
R_LIBS_SITE="C:/Program Files/R/R-3.6.3/library"
R_HISTSIZE=100000
GITHUB_PAT=abc123

I tried using the usethis:: command but my RStudio does not recognize it. I am able to load packages in R but not in RStudio.

Sys.getenv("R_HOME")
[1] "C:/PROGRA~1/R/R-36~1.3"

Please help me as I am at a lost for words on how to fix this issue. I am sorry that I am so incompetent.

This is what I have in my .Renviron file

R_LIBS_SITE="C:/Program Files/R/R-3.6.3/library"
R_LIBS_USER="C:/Users/Sterling L. Wright/Documents/R/win-library/3.6"
R_HISTSIZE=100000
GITHUB_PAT=abc123
PATH=/C:/Users/Sterling L. Wright/Documents/R/win-library/3.6
#PATH="{RTOOLS40_HOME}\usr\bin;{PATH}"

It is located in
/mnt/c/Users/Sterling L. Wright/Documents

Hi,

Did you try and reinstall the dplyr package, and the ellipsis package? Sometime that just fixes the issues.

Let me know if this helps,
PJ

Hi, PJ,

Thank you for your help. Unfortunately, that did not work. Here is the output:

remove.packages(c("dplyr", "ellipsis"))
Removing packages from ‘C:/Users/Sterling L. Wright/Documents/R/win-library/4.0’
(as ‘lib’ is unspecified)
install.packages(c("dplyr", "ellipsis"))
WARNING: Rtools is required to build R packages but is not currently installed. Please download and install the appropriate version of Rtools before proceeding:

https://cran.rstudio.com/bin/windows/Rtools/
Installing packages into ‘C:/Users/Sterling L. Wright/Documents/R/win-library/4.0’
(as ‘lib’ is unspecified)
trying URL 'https://cran.rstudio.com/bin/windows/contrib/4.0/dplyr_1.0.1.zip'
Content type 'application/zip' length 1309742 bytes (1.2 MB)
downloaded 1.2 MB

trying URL 'https://cran.rstudio.com/bin/windows/contrib/4.0/ellipsis_0.3.1.zip'
Content type 'application/zip' length 46076 bytes (44 KB)
downloaded 44 KB

package ‘dplyr’ successfully unpacked and MD5 sums checked
package ‘ellipsis’ successfully unpacked and MD5 sums checked

The downloaded binary packages are in
C:\Users\Sterling L. Wright\AppData\Local\Temp\RtmpawAqWQ\downloaded_packages

remove.packages(c("dplyr", "ellipsis"))
Removing packages from ‘C:/Users/Sterling L. Wright/Documents/R/win-library/4.0’
(as ‘lib’ is unspecified)
install.packages(c("dplyr", "ellipsis"))
WARNING: Rtools is required to build R packages but is not currently installed. Please download and install the appropriate version of Rtools before proceeding:

https://cran.rstudio.com/bin/windows/Rtools/
Installing packages into ‘C:/Users/Sterling L. Wright/Documents/R/win-library/4.0’
(as ‘lib’ is unspecified)
trying URL 'https://cran.rstudio.com/bin/windows/contrib/4.0/dplyr_1.0.1.zip'
Content type 'application/zip' length 1309742 bytes (1.2 MB)
downloaded 1.2 MB

trying URL 'https://cran.rstudio.com/bin/windows/contrib/4.0/ellipsis_0.3.1.zip'
Content type 'application/zip' length 46076 bytes (44 KB)
downloaded 44 KB

package ‘dplyr’ successfully unpacked and MD5 sums checked
package ‘ellipsis’ successfully unpacked and MD5 sums checked

The downloaded binary packages are in
C:\Users\Sterling L. Wright\AppData\Local\Temp\RtmpawAqWQ\downloaded_packages

library(dplyr)
Error: package or namespace load failed for ‘dplyr’ in library.dynam(lib, package, package.lib):
DLL ‘vctrs’ not found: maybe not installed for this architecture?
In addition: Warning message:
S3 methods ‘!.vctrs_vctr’, ‘!=.vctrs_vctr’, ‘$.vctrs_list_of’, ‘$.vctrs_rcrd’, ‘$.vctrs_sclr’, ‘$.vctrs_vctr’, ‘$<-.vctrs_list_of’, ‘$<-.vctrs_rcrd’, ‘$<-.vctrs_sclr’, ‘$<-.vctrs_vctr’, ‘%%.vctrs_vctr’, ‘%/%.vctrs_vctr’, ‘&.vctrs_vctr’, ‘*.vctrs_vctr’, ‘+.vctrs_vctr’, ‘-.vctrs_vctr’, ‘/.vctrs_vctr’, ‘<.vctrs_vctr’, ‘<=.vctrs_vctr’, ‘==.vctrs_vctr’, ‘>.vctrs_vctr’, ‘>=.vctrs_vctr’, ‘[.vctrs_rcrd’, ‘[.vctrs_sclr’, ‘[.vctrs_unspecified’, ‘[.vctrs_vctr’, ‘[<-.vctrs_list_of’, ‘[<-.vctrs_rcrd’, ‘[<-.vctrs_sclr’, ‘[<-.vctrs_vctr’, ‘[[.vctrs_list_of’, ‘[[.vctrs_rcrd’, ‘[[.vctrs_sclr’, ‘[[.vctrs_vctr’, ‘[[<-.vctrs_list_of’, ‘[[<-.vctrs_rcrd’, ‘[[<-.vctrs_sclr’, ‘[[<-.vctrs_vctr’, ‘^.vctrs_vctr’, ‘dim<-.vctrs_sclr’, ‘dim<-.vctrs_vctr’, ‘dimnames<-.vctrs_sclr’, ‘dimnames<-.vctrs_vctr’, ‘is.na<-.vctrs_sclr’, ‘is.na<-.vctrs_vctr’, ‘length<-.vctrs_rcrd’, ‘length<-.vctrs_vctr’, ‘levels<-.vctrs_sclr’, ‘levels<-.vctrs_vctr’, ‘names<-.vctrs_sclr’, ‘names<-.vctrs_vctr’, ‘|.vctrs_vctr’, ‘Complex.vctrs_scl [... truncated]
Error: cannot open file 'C:/Users/Sterling L. Wright/Documents/R/win-library/4.0/BiocManager/R/BiocManager.rdb': No such file or directory
In addition: Warning message:
restarting interrupted promise evaluation

I am so sorry.

Some comments:

In get(Info[i, 1], envir = env) : internal error -3 in R_decompress1

This always means you need to restart R after you installed a new package while it was in use. If that doesn't work, close all your R sessions, and reinstall the package in a fresh R session that does not have the package currently loaded.

library(dplyr)
Error: package or namespace load failed for ‘dplyr’ in library.dynam(lib, package, package.lib):
DLL ‘vctrs’ not found: maybe not installed for this architecture?

If you read the error message, it looks like the vctrs package (on which dplyr depends) is broken. Again: close and restart R, and install.packages("vctrs").

Removing packages from ‘C:/Users/Sterling L. Wright/Documents/R/win-library/4.0’

Your username has spaces in it. This is very likely to cause problems. If you can, please create a username without spaces or diacritics, it will make everything work much better.

2 Likes