Error: package or namespace load failed for ‘tidyverse’ in loadNamespace
Asked Answered
U

8

28

I'm getting the following error when I'm loading tidyverse. It was all working fine a few minutes ago when I was running my shinyapp. How should I resolve this?

Error: package or namespace load failed for ‘tidyverse’ in loadNamespace(i, c(lib.loc, .libPaths()), versionCheck = vI[[i]]): namespace ‘rlang’ 0.3.0.1 is already loaded, but >= 0.3.1 is required

Usually answered 29/3, 2019 at 10:41 Comment(3)
hi, try to uninstall and reinstall the rlang package. Also check your libray paths. You can do so by typing .libPaths().Iminourea
Sure, thanks much. That worked.Usually
Make sure that another R process/session that has the package loaded isn't running at the same time you're trying to reinstall the same package.Prader
S
38

I had the same problem but managed to tackle it. You may remove the current version of rlang using the following command:

remove.packages("rlang")

and then install the rlang again:

install.packages("rlang")

After that run the library:

library(tidyverse)
Squires answered 21/12, 2019 at 11:51 Comment(3)
This worked nicely for me!Licentiate
This didn't work in my case.Spalding
Worked thanks. Jesus. what a sh1t show. I'll be glad in the near future when all this grunt work will be taken care of by AI agents. That day can't come soon enough.Contraoctave
U
5

In addition to unloading and reloading rlang,

Click on Tools in the tab and check for Package Updates to update tidyverse

Unscreened answered 15/5, 2022 at 23:49 Comment(2)
Rather than submitting a new answer, this suggestion would be more appropriate as a comment on another answer.Kunstlied
10 reputation is required to leave a comment; Ibrahim doesn't currently have that optionUnbutton
A
4

I faced this same problem and restarted R session and it worked fine after that.

Audio answered 5/1, 2020 at 17:16 Comment(0)
R
2

Also had similar problem but resolved it after a struggle. I used:-

devtools::install_github("tidyverse/tidyverse")
Rader answered 24/4, 2020 at 10:27 Comment(0)
L
2

I have just encountered the similar problem.

The error could translate into understandable English as:

package 'rlang' version 0.3.0.1 is loaded into R successfully, but the other package that based on 'ralng' required a higher version (at least 0.3.1).

So that manually install.packages('rlang') will update the latest appropriate package 'rlang'

Lisandra answered 23/6, 2021 at 9:12 Comment(0)
U
1

I know this might be late answer,but I had the same issue and I fixed it by updating the packages, specifically : ggplot2, scales. according to this Rstudio site

Unequivocal answered 22/7, 2020 at 20:54 Comment(0)
G
1

Start with install.packages("devtools") then install.packages("rlang").

Giddings answered 14/10, 2022 at 12:40 Comment(1)
Your answer could be improved with additional supporting information. Please edit to add further details, such as citations or documentation, so that others can confirm that your answer is correct. You can find more information on how to write good answers in the help center.Numskull
M
1

I encountered the same error, but none of the solutions mentioned above worked. Instead, I resolved it by manually removing the 'cli' module, which was causing the error, from the folder where my packages for the version of R that I was using installed. You can use .libPaths() to help locate the directory where the packages are installed.

Misery answered 9/9, 2023 at 18:13 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.