Readr loading error HELP

Hi - hoping someone can help with an error that I'm getting when I try to load the 'readr' package. The error message I'm getting looks like this:

library('readr')
Error: package or namespace load failed for ‘readr’:
.onLoad failed in loadNamespace() for 'readr', details:
call: loadNamespace(name)
error: object 'pkgInfo' not found
In addition: Warning messages:
1: package ‘readr’ was built under R version 4.0.5
2: In loadNamespace(name) : package ‘tzdb’ has no 'package.rds' in Meta/

Have you tried reinstalling it? install.packages("readr")

hi, yep same problem

Error: package or namespace load failed for ‘readr’:
 .onLoad failed in loadNamespace() for 'readr', details:
  call: loadNamespace(name)
  error: object 'pkgInfo' not found
In addition: Warning messages:
1: package ‘readr’ was built under R version 4.0.5 
2: In loadNamespace(name) : package ‘tzdb’ has no 'package.rds' in Meta/

What version of R are you using?

I am using version 4.0.2

It also looks like you may have a broken version of tzdb. You could also try install.packages(“tzdb”) then restart R

yeah tried this too, but no luck

So what does library(tzdb) do in a completely new R session?

> library(tzdb)
Error in library(tzdb) : ‘tzdb’ is not a valid installed package

Ok, I think you should try:

  1. remove.packages("tzdb")
  2. Restart R
  3. Call install.packages("tzdb") and post the entire output of that for us to look at
remove.packages("tzdb")
Removing package from ‘C:/Users//OneDrive - WBG/Documents/R/win-library/4.0’
(as ‘lib’ is unspecified)
Warning in remove.packages :
  cannot delete reparse point 'C:/Users//OneDrive - WBG/Documents/R/win-library/4.0/tzdb/Meta', reason 'There is a mismatch between the tag specified in the request and the tag present in the reparse point'

Restarting R session...

> install.packages("tzdb")
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 package into ‘C:/Users//OneDrive - WBG/Documents/R/win-library/4.0’
(as ‘lib’ is unspecified)
trying URL 'https://cran.rstudio.com/bin/windows/contrib/4.0/tzdb_0.2.0.zip'
Content type 'application/zip' length 1445229 bytes (1.4 MB)
downloaded 1.4 MB

package ‘tzdb’ successfully unpacked and MD5 sums checked
Warning in install.packages :
  cannot delete reparse point 'C:\Users\\OneDrive - WBG\Documents\R\win-library\4.0/tzdb/Meta', reason 'There is a mismatch between the tag specified in the request and the tag present in the reparse point'
Warning in install.packages :
  cannot remove prior installation of package ‘tzdb’
Warning in install.packages :
  cannot delete reparse point 'C:\Users\\OneDrive - WBG\Documents\R\win-library\4.0/tzdb/Meta', reason 'There is a mismatch between the tag specified in the request and the tag present in the reparse point'
Warning in install.packages :
  restored ‘tzdb’

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

Okay you seem to have a broken version of tzdb installed somehow that R can't delete. Can you try:

  1. Close out of R / RStudio entirely
  2. Go to C:\Users\\OneDrive - WBG\Documents\R\win-library\4.0 and delete the entire tzdb folder
  3. Open RStudio
  4. install.packages("tzdb")

There are also reports here that OneDrive locks files incorrectly. So your problem is likely that your R package library is on your OneDrive, which is causing issues like this installing and removing odbc R package on Windows 10 - Stack Overflow

so I tried to delete the tzdb folder directly, but am unable to. The folder has been "syncing" in the one drive for a suspicious amount of time

Maybe you can force one drive to stop syncing temporarily, and delete it that way?

In general, if you are able to do so then I would recommend moving your R package library off of OneDrive and onto your computer's local storage, I think this will save you a lot of headache in the end if you use R a lot.

1 Like

Within the last 24 hours (but not before) I also received errors relating to readr , for me it was crashing deployment of my Shiny app. Specifically it was at this step

building: Building package: readr

which did not occur before. I uninstall/re-installed it but no luck. The only success I had was to uninstall the version of R I was using, delete the old readr library (and I also removed several others) - then upgraded to R 4.1.2 and do a fresh install.packages("readr")

A new version of readr just went to CRAN and the binaries haven't all been built yet, so your computer was trying to install it from source (which is sometimes harder / more prone to issues). It is possible the 4.1.2 binary was built, but the one for your older version of R wasn't, so that may be why updating helped. In a few days CRAN should have all of the binaries built so this won't be an issue anymore.

2 Likes

This topic was automatically closed 21 days after the last reply. New replies are no longer allowed.

If you have a query related to it or one of the replies, start a new topic and refer back with a link.