R package: Unable to install 'rlang' Error in unloadNamespace("rlang")

56 views Asked by At

I am not using PC platform Rstudio but Rstudio workbench, which has pre-installed packages itself on public lib, including rlang(1.0.6). These packages are access limited and can not be uninstalled from my side. But I need a latest version of rlang. So I decide to install one onto my personal lib. The question came when I tried to install by

remotes::install_version('rlang', version="1.1.3", repos = "http://cran.us.r-project.org", lib="~/cflib")`.

However, I got an error:

Error in unloadNamespace("rlang") : 
namespace ‘rlang’ is imported by ‘tibble’, ‘haven’, ‘hms’, ‘forcats’, ‘ellipsis’, ‘vctrs’, ‘pillar’, ‘lifecycle’ 
  so cannot be unloaded
Execution halted

I checked that those packages were not libraried. I unloadnamespace the mentioned packages.

R 4.1.0

loadedNamespaces()
# [1] "rstudioapi" "grDevices"  "tools"      "utils"      "stats"      "datasets"  
# [7] "base"       "graphics"   "compiler"   "methods"  

As I made sure they are not loaded or attached I tried install again but the error still remained. I have searched and most answers were telling me to uninstall 'rlang' but it is not practical in my case. Also restarting session did not help.

Is there a way I can install the latest rlang despite the older version on public lib?

Question update: what I get from search:

> R 4.1.0> search()  [1] ".GlobalEnv"        "tools:rstudio"    
> "package:stats"     "package:graphics"   [5] "package:grDevices"
> "package:utils"     "package:datasets"  "package:methods"    [9]
> "Autoloads"         "package:base"

Below is what I get from sessioninfo() after an restart:

> R version 4.1.0 (2021-05-18) Platform: x86_64-pc-linux-gnu (64-bit)
> Running under: Red Hat Enterprise Linux
> 
> Matrix products: default BLAS/LAPACK:
> /XXXXPubliclibraryLocation.../2019.1.144-gompi-2019a/compilers_and_libraries_2019.1.144/linux/mkl/lib/intel64_lin/libmkl_gf_lp64.so
> 
> locale:  [1] LC_CTYPE=en_US.UTF-8       LC_NUMERIC=C              
> LC_TIME=en_US.UTF-8         [4] LC_COLLATE=en_US.UTF-8    
> LC_MONETARY=en_US.UTF-8    LC_MESSAGES=en_US.UTF-8     [7]
> LC_PAPER=en_US.UTF-8       LC_NAME=C                  LC_ADDRESS=C    
> [10] LC_TELEPHONE=C             LC_MEASUREMENT=en_US.UTF-8
> LC_IDENTIFICATION=C       
> 
> attached base packages: [1] stats     graphics  grDevices utils    
> datasets  methods   base     
> 
> loaded via a namespace (and not attached):  [1] fansi_1.0.4    
> tzdb_0.3.0      utf8_1.2.3      R6_2.5.1        lifecycle_1.0.3  [6]
> magrittr_2.0.3  pillar_1.8.1    rlang_1.0.6     cli_3.6.0      
> rstudioapi_0.14 [11] vctrs_0.5.2     ellipsis_0.3.2  tools_4.1.0    
> forcats_1.0.0   readr_2.1.3     [16] glue_1.6.2      hms_1.1.2      
> compiler_4.1.0  pkgconfig_2.0.3 haven_2.5.1     [21] tibble_3.1.8
0

There are 0 answers