Can't load Tidyverse

Hello, I'm very new to R and am having trouble installing Tidyverse on my work computer. I have not had this issue on my personal computer or other computers at work. When I install tidyverse (I've done both install.packages("tidyverse") as well as use the Install option under the Packages tab in the bottom right pane. The very first time I did this, it seemed to install correctly (giving me the very long list of outputs that come with installing Tidyverse). However, when I went to call it by library(tidyverse), it gave me this:

Error: package or namespace load failed for ‘tidyverse’ in loadNamespace(j <- i[[1L]], c(lib.loc, .libPaths()), versionCheck = vI[[j]]):
 there is no package called ‘pkgconfig’

I tried installing pkgconfig through install.packages("pkgconfig") and got this:

 There is a binary version available but the source version is
  later:
          binary source needs_compilation
pkgconfig  2.0.2  2.0.3             FALSE

installing the source package ‘pkgconfig’

trying URL 'https://cran.rstudio.com/src/contrib/pkgconfig_2.0.3.tar.gz'
Content type 'application/x-gzip' length 6080 bytes
downloaded 6080 bytes

'\\STORAGE\Users\teresas\My Documents'
CMD.EXE was started with the above path as the current directory.
UNC paths are not supported.  Defaulting to Windows directory.
* installing *source* package 'pkgconfig' ...
** package 'pkgconfig' successfully unpacked and MD5 sums checked
** using staged installation
** R
** inst
Warning in file.create(to[okay]) :
  cannot create file '\STORAGE/Users/teresas/My Documents/R/R-3.6.1/library/00LOCK-pkgconfig/00new/pkgconfig/NEWS.markdown', reason 'No such file or directory'
Warning in file.create(to[okay]) :
  cannot create file '\STORAGE/Users/teresas/My Documents/R/R-3.6.1/library/00LOCK-pkgconfig/00new/pkgconfig/README.Rmd', reason 'No such file or directory'
Warning in file.create(to[okay]) :
  cannot create file '\STORAGE/Users/teresas/My Documents/R/R-3.6.1/library/00LOCK-pkgconfig/00new/pkgconfig/README.markdown', reason 'No such file or directory'
** byte-compile and prepare package for lazy loading
Error in findpack(package, lib.loc) : 
  there is no package called 'pkgconfig'
Calls: <Anonymous> -> findpack
Execution halted
ERROR: lazy loading failed for package 'pkgconfig'
* removing '\\STORAGE/Users/teresas/My Documents/R/R-3.6.1/library/pkgconfig'
Warning in install.packages :
  installation of package ‘pkgconfig’ had non-zero exit status

The downloaded source packages are in
	‘C:\Users\teresas\AppData\Local\Temp\RtmpiiktWw\downloaded_packages’

Then when I tried to call pkgconfig through library(pkgconfig) I got this:

Error in library(pkgconfig) : there is no package called ‘pkgconfig’

I have since uninstalled and reinstalled both R for Windows and RStudio (separately - I uninstalled R first, tried to see if that fixed it, and then did Rstudio). Still the same problem. I've tried doing install.packages("tidyverse", dependencies = TRUE) but still got the same message. If I try installing individual packages from Tidyverse, same message. But if I install a package not related to Tidyverse, like Shiny, that works. My work IT has not been able to figure this out either, although I don't know how much experience they have with RStudio or Tidyverse.

I've tried uninstalling/reinstalling Tidyverse many, many times, but still the same thing. Also, even after completely uninstalling R and RStudio, when install Tidyverse, this is all I get:

trying URL 'https://cran.rstudio.com/bin/windows/contrib/3.6/tidyverse_1.2.1.zip'
Content type 'application/zip' length 93051 bytes (90 KB)
downloaded 90 KB

package ‘tidyverse’ successfully unpacked and MD5 sums checked

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

Also, I seem to be having similar problems installing reprex as well as I get an error message saying Error in loadNamespace(name) : there is no package called ‘callr’

Help? I've looked at other posts that had a similar problem of saying a certain package wasn't installed when trying to call Tidyverse, but the proposed solutions haven't worked for me (or I don't understand them).

It seems like you are trying to install into a network drive, very often this brings this kind of issues, I recommend you to set your library path on a local folder instead.

1 Like

Do you know how I can change this? I tried changing the working directory to a folder on my local computer, but I'm still getting the same message. Thank you so much for your help.

The working directory is not the same as the library path, you can select a different locations using the lib parameter on install.packages() function, like this for example:

install.packages("tidyverse", lib = "C:\\Program Files\\R\\R-3.6.1\\library")

But it has to be a folder already present on .libPaths() and you must have write permission on that folder, or you would have to add one.

If you’re unfamiliar with how R libraries (where packages live) work, reading through these might help:

https://cran.r-project.org/doc/manuals/r-release/R-admin.html#Managing-libraries

Particularly, if you follow the advice in What They Forgot…, you only need to set R_LIBS_USER to a non-network path (or if it’s already a non-network path, create the folder it’s pointing to so that R will actually start using it as the install location for packages you have installed yourself).

1 Like

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