tidyverse not loaded, it says "namespace ‘vctrs’ 0.2.0 is already loaded, but >= 0.2.1 is required"
Asked Answered
F

5

15

strong textI keep encountering problems with installing tidyverse package, which preventing me from implementing many text processing tasks. The problem is the same as those mentioned in many previous threads since 2017 in that when I enter library(tidyverse) or try to open other related packages, they always say it requires 0.2.1 version of vctrs. I have tried using remote download or download other temporary versions but to avail. Could someone help me on this?

I'm using the latest version of R (version 3.6.1), running on Rstudio 1.2.5033. I also updated my vctrs package.

install.packages("tidyverse")
devtools::install_github("tidyverse/tidyverse")
library(tidyverse)
Error: package or namespace load failed for ‘tidyverse’ in loadNamespace(i, c(lib.loc, .libPaths()), versionCheck = vI[[i]]):
 namespace ‘vctrs’ 0.2.0 is already loaded, but >= 0.2.1 is required
In addition: Warning message:
package ‘tidyverse’ was built under R version 3.6.2 


library(devtools)
devtools::install_github("tidyverse/tidyverse")
library(tidyverse)
Error: package or namespace load failed for ‘tidyverse’ in loadNamespace(i, c(lib.loc, .libPaths()), versionCheck = vI[[i]]):
 namespace ‘vctrs’ 0.2.0 is already loaded, but >= 0.2.1 is required
In addition: Warning message:
package ‘tidyverse’ was built under R version 3.6.2 
Flacon answered 28/2, 2020 at 12:40 Comment(9)
Maybe try to reinstall vctrs?Rusell
I've tried that but didn't work.Flacon
Are you loading vctrs before tidyverse? Try restarting R and do it the other way around.Rusell
Show your attempt. Because that's the problemImpeller
@Chris T. Do you have Rstudio open? Or another instance of R running? If so, close all other apps using R and open one. Then try to install vctrs package again.Sepoy
@Edward, that's what I've been doing. I kept unstalling and installing all these packages to see what've been changed, but just could not get tidyverse open without showing error message, some with the gutenbergr package. There're so many previous threads on this, but all solutions don't work on mine. When I enter library(tidyverse), I always receive Error: package or namespace load failed for ‘tidyverse’ in loadNamespace(i, c(lib.loc, .libPaths()), versionCheck = vI[[i]]): namespace ‘vctrs’ 0.2.0 is already loaded, but >= 0.2.1 is requiredFlacon
Ok, just give me a couple minutes, and I will get back to you all, hope that works :-/Flacon
If that doesn't work, Quit R and then navigate to the vctrs folder on your computer. On Windows, it may be something like: C:\Users\Chris\Documents\R\win-library\3.6\vctrs. Delete it. Open R, try to install it again.Sepoy
YES, it works. Would you put this in the answer, so I can mark it as solved, and this should help others, as I say so many fellow tidyverse users have asked this on different forums?Flacon
B
6

It´s important to check for packages updates. It´s in tool menu->check for package updates->choose the packages. I had the same problem with other package "drc" and it gave me the same error with old version of "vctr".

Banderole answered 24/6, 2021 at 0:39 Comment(0)
Q
17

This has already been answered above, and I am leaving my notes for other "beginners" that may have run into the same thing. I encountered this issue after installing tidymodels (have since removed).

  • Had issue with rlang first: namespace ‘rlang’ 0.4.7 is already loaded, but >= 0.4.10 is required
  • remove.packages("rlang"), install.packages("rlang")
  • Then had issue with vctrs: namespace ‘vctrs’ 0.3.2 is already loaded, but >= 0.3.6 is required
  • does not respond to the remove/install process.
  • Shut down R, manually delete the vctrs directory from lib, per Edward's message above. Will be somewhere like: C:\Users\Chris\Documents\R\win-library\3.6\vctrs
  • Start RStudio. install.packages("vctrs")

After this, I could load tidyverse again.

Quipu answered 11/3, 2021 at 1:52 Comment(1)
So many thanks, your answers, on point 3 and 5 and 6 worked for all the issues I was having. I tried several options but seems there are some that work one of them and others needs the manual removal.Fiche
B
6

It´s important to check for packages updates. It´s in tool menu->check for package updates->choose the packages. I had the same problem with other package "drc" and it gave me the same error with old version of "vctr".

Banderole answered 24/6, 2021 at 0:39 Comment(0)
S
4

You've probably got more than one instance of R running with those tidyverse packages loaded. Not sure about other operating systems, but on Windows, if these packages are being used, then those DLL files will be in use and you cannot delete them, which is what the install.packages() function will try to do.

So, just close all but one instance of R, maybe restart the computer just to be sure, and try again.

Sepoy answered 28/2, 2020 at 13:32 Comment(2)
This is a very informative answer. Is it not therefore kind of irresponsible for R to allow installation when other instances of R are running and DLL files potentially in use? (or is there simply no way for an R instance trying to install.packages() to tell if those DLL files could be in use?) To not even warn seems a little reckless, but understandable if there's no way of knowingTauten
Somewhat related: #60910534Tauten
S
1

I had the same issue: namespace 'vctrs' 0.3.7 is already loaded, but >= 0.3.8 is required

I tried:

unloadNamespace("vctrs")

namespace 'vctrs' is imported by 'pillar' so cannot be unloaded

So then:

install.packages("pillar")

It automatically restarts R and re-installs pillar. This worked for me!

Subvene answered 4/6, 2021 at 15:51 Comment(2)
Mine said similar but imported by purrr. Tried installing purrr, but did not work as for this poster.Genie
This did work for me instead: install.packages("vctrs") unload(vctrs) library(vctrs) and was from there able to load the library I was trying to load in the first placeGenie
E
1

I had the same problem and I installed Rtools, which is a package management tool for R, from https://cran.r-project.org/bin/windows/Rtools/ and it worked!

Experiential answered 31/1, 2023 at 19:6 Comment(0)

© 2022 - 2025 — McMap. All rights reserved.