Difficulty installing dev version of ggplot2 due to rlang::is_list not being found

Hi all,

Is anyone else encountering issues installing the dev version of ggplot2? I fully appreciate that I am subject to unforeseen issues etc using the dev version of something but this error seems fairly straight forward and I was wondering if anyone has encountered it.

devtools::install_github("tidyverse/ggplot2")

This installs the dev version of rlang as well but the actual installation of ggplot2 fails with this error:

* installing *source* package 'ggplot2' ...
** R
** data
*** moving datasets to lazyload DB
** inst
** tests
** byte-compile and prepare package for lazy loading
Error in is_list(x) : object 'rlang_is_list' not found
Error : unable to load R code in package 'ggplot2'
ERROR: lazy loading failed for package 'ggplot2'
* removing 'C:/Users/salbers/R/win-library/3.5/ggplot2'
* restoring previous 'C:/Users/salbers/R/win-library/3.5/ggplot2'
In R CMD INSTALL
Installation failed: Command failed (1)

Sure enough rlang::is_list() outputs an error:

> rlang::is_list()
Error in rlang::is_list() : object 'rlang_is_list' not found

rlang::is_list is an exported object from the package:

and the underlying c++ code seems to be there:

All this makes me think that this is something wrong with me/my system but I can't for the life of me figure it out.

So is anyone else experiencing this behaviour when installing the dev version of ggplot2?

Session Info
Session info -----------------------------------------------------------------------------------------------------
 setting  value                       
 version  R version 3.5.0 (2018-04-23)
 system   x86_64, mingw32             
 ui       RStudio (1.2.616)           
 language (EN)                        
 collate  English_Canada.1252         
 tz       America/Los_Angeles         
 date     2018-05-08                  

Packages ---------------------------------------------------------------------------------------------------------
 package   * version    date       source                       
 backports   1.1.2      2017-12-13 CRAN (R 3.5.0)               
 base      * 3.5.0      2018-04-23 local                        
 compiler    3.5.0      2018-04-23 local                        
 curl        3.2        2018-03-28 CRAN (R 3.5.0)               
 datasets  * 3.5.0      2018-04-23 local                        
 devtools  * 1.13.5     2018-02-18 CRAN (R 3.5.0)               
 digest      0.6.15     2018-01-28 CRAN (R 3.5.0)               
 git2r       0.21.0     2018-01-04 CRAN (R 3.5.0)               
 graphics  * 3.5.0      2018-04-23 local                        
 grDevices * 3.5.0      2018-04-23 local                        
 httr        1.3.1      2017-08-20 CRAN (R 3.5.0)               
 knitr       1.20       2018-02-20 CRAN (R 3.5.0)               
 lobstr    * 0.0.0.9000 2018-04-30 Github (r-lib/lobstr@75254f1)
 magrittr    1.5        2014-11-22 CRAN (R 3.5.0)               
 memoise     1.1.0      2017-04-21 CRAN (R 3.5.0)               
 methods   * 3.5.0      2018-04-23 local                        
 R6          2.2.2      2017-06-17 CRAN (R 3.5.0)               
 Rcpp        0.12.16    2018-03-13 CRAN (R 3.5.0)               
 rlang       0.2.0.9001 2018-05-08 Github (r-lib/rlang@b197278) 
 stats     * 3.5.0      2018-04-23 local                        
 testthat  * 2.0.0      2017-12-13 CRAN (R 3.5.0)               
 tools       3.5.0      2018-04-23 local                        
 usethis   * 1.3.0      2018-02-24 CRAN (R 3.5.0)               
 utils     * 3.5.0      2018-04-23 local                        
 withr       2.1.2      2018-03-15 CRAN (R 3.5.0) 
1 Like

Well, I was ploting some graphics using ggplot. But now I run the code again and got this same error.
I tested some examples of ggplot and I'm also getting this error, I don't know what it is but its weird.

I don't know if these problems are related or not, but there's some talk of trouble with github ggplot2 (and rlang) over in this thread:

Seems like a wait and see approach for now. At least other folks appear to be having the same issue.

I've just installed the latest ggplot2 dev and used it without any issue. Maybe try to install rlang and ggplot2 to a new library folder using .libPaths(), lib & lib.loc?

Session info -------------------------------------------------------------------------
 version  R version 3.5.0 (2018-04-23)
 ui       RStudio (1.1.447)           

Packages -----------------------------------------------------------------------------
 package    * version    date       source                              
 assertthat   0.2.0      2017-04-11 CRAN (R 3.5.0)                      
 base       * 3.5.0      2018-04-23 local                               
 bindr        0.1.1      2018-03-13 CRAN (R 3.5.0)                      
 bindrcpp     0.2.2      2018-03-29 CRAN (R 3.5.0)                      
 devtools     1.13.5     2018-02-18 CRAN (R 3.5.0)                      
 digest       0.6.15     2018-01-28 CRAN (R 3.5.0)                      
 dplyr      * 0.7.5.9000 2018-05-08 Github (tidyverse/dplyr@2d1c763)    
 ggplot2    * 2.2.1.9000 2018-05-08 Github (tidyverse/ggplot2@e6d2544)  
 git2r        0.21.0     2018-01-04 CRAN (R 3.5.0)                      
 glue         1.2.0      2017-10-29 CRAN (R 3.5.0)                      
 hms          0.4.2      2018-04-24 Github (tidyverse/hms@c0cfc01)      
 lubridate    1.7.4      2018-05-02 Github (tidyverse/lubridate@45395b4)
 magrittr     1.5        2014-11-22 CRAN (R 3.5.0)                      
 memoise      1.1.0      2017-04-21 CRAN (R 3.5.0)                      
 pillar       1.2.2      2018-04-27 Github (r-lib/pillar@534f7e8)       
 purrr      * 0.2.4.9000 2018-05-05 Github (tidyverse/purrr@d0a8081)    
 Rcpp         0.12.16    2018-03-13 CRAN (R 3.5.0)                      
 readr      * 1.2.0      2018-05-04 Github (tidyverse/readr@8186639)    
 readxl       1.1.0.9000 2018-04-28 Github (tidyverse/readxl@66df4b9)   
 rlang      * 0.2.0.9001 2018-05-08 Github (r-lib/rlang@b197278)        
 scales       0.5.0.9000 2018-04-24 Github (hadley/scales@d767915)      
 tibble     * 1.4.2.9001 2018-04-24 Github (tidyverse/tibble@b90a4fd)   
 tidyr      * 0.8.0      2018-01-29 CRAN (R 3.5.0)                      
 tidyselect   0.2.4      2018-02-26 CRAN (R 3.5.0)                      
 tidyverse  * 1.2.1.9000 2018-04-27 Github (tidyverse/tidyverse@83f6ec3)
 withr        2.1.2      2018-04-24 Github (jimhester/withr@79d7b0d)    
 yaml         2.1.19     2018-05-01 CRAN (R 3.5.0) 

Make sure that you're installing your R packages in a clean R session. If you already have rlang loaded when you attempt to install a new version, it's possible that installation can (somewhat quietly) fail when attempting to copy over rlang.so, which would leave you with a temporarily broken rlang.

I would recommend trying to reinstall both rlang and ggplot2 in a clean R session.

4 Likes

I reinstalled and now everything is right.
I used the function removeDepends() from here to remove the packages and installed again.

thanks @kevinushey.

I was able to get a little further in the installation process by commenting out devtools, usethis, testthat and lobstr from my .rprofile. That resulted in R telling me that rlang was not found. Basically I am at the same place as this post:

and here:

Can you try launching R from a terminal / console session, with something like:

R --vanilla

Then, you can attempt an uninstall and reinstall of rlang with something like:

remove.packages("rlang")
install.packages("rlang")

I think one of the challenges here might be that devtools itself depends on rlang, so if you attempt to install rlang with something like:

devtools::install_github("r-lib/rlang")

then things can go awry as you end up installing a package that is already loaded in R. Unfortunately, on Windows using devtools to install packages that devtools itself depends on does not work very well (especially for packages containing compiled code).

1 Like

Sorry @kevinushey I think my response was a bit obtuse. Installation of rlang proceeds fine using either the CRAN or the dev version. The issue arise, even when I use a R --vanilla session, when I try to install the dev version of ggplot2 which installs dev rlang fine but then fails on this error:

*** arch - i386
Error: package or namespace load failed for 'ggplot2' in library.dynam(lib, package, package.lib):
DLL 'rlang' not found: maybe not installed for this architecture?
Error: loading failed
Execution halted
*** arch - x64
ERROR: loading failed for 'i386'

  • removing 'C:/Users/salbers/R/win-library/3.5/ggplot2'
    Warning messages:
    1: In i.p(...) :
    installation of package 'C:/Users/salbers/AppData/Local/Temp/RtmpYl6r7C/remotes29ac1cfd59b9/lionel--freetypeharfbuzz-f659ba0' had non-zero exit stat
    us
    2: In i.p(...) :
    installation of package 'C:/Users/salbers/AppData/Local/Temp/RtmpYl6r7C/remotes29ac63553a89/lionel--vdiffr-50584ec' had non-zero exit status
    3: In i.p(...) :
    installation of package 'C:/Users/salbers/AppData/Local/Temp/RtmpYl6r7C/remotes29ac317d240/tidyverse-ggplot2-d3bd92e' had non-zero exit status

I tried with the remotes packages as well because it does not depend on rlang but that did not yield any different results. FWIW, I fully understand that using the dev version exposes me to exactly this type of thing.

1 Like

That still appears to be some form of issue where rlang was not fully installed. Can you give the entire output of what you get when attempting to install rlang, both the command you ran and the output you saw?

1 Like

A second try at a vanilla R session after fully removing rlang and ggplot2 resulted in successfully installing dev ggplot2. Thanks @kevinushey!

3 Likes