pak icon indicating copy to clipboard operation
pak copied to clipboard

Newer version (0.2.0) does not work on windows os

Open psychelzh opened this issue 3 years ago • 15 comments

Installation is okay, but using it will throw error:

install.packages("pak")
#> Installing package into 'C:/Users/liang/Documents/R/win-library/4.1'
#> (as 'lib' is unspecified)
#> package 'pak' successfully unpacked and MD5 sums checked
#> 
#> The downloaded binary packages are in
#>  C:\Users\liang\AppData\Local\Temp\RtmpeKePxh\downloaded_packages
pak::lib_status()
#> Error in load_private_package("glue"): Cannot load glue from the private library

Created on 2021-12-04 by the reprex package (v2.0.1)

Session info
sessioninfo::session_info()
#> - Session info  --------------------------------------------------------------
#>  hash: palms up together: medium skin tone, roll of paper, person surfing: light skin tone
#> 
#>  setting  value
#>  version  R version 4.1.2 (2021-11-01)
#>  os       Windows 10 x64 (build 22000)
#>  system   x86_64, mingw32
#>  ui       RTerm
#>  language en
#>  collate  Chinese (Simplified)_China.936
#>  ctype    Chinese (Simplified)_China.936
#>  tz       Asia/Taipei
#>  date     2021-12-04
#>  pandoc   2.14.0.3 @ C:/Program Files/RStudio/bin/pandoc/ (via rmarkdown)
#> 
#> - Packages -------------------------------------------------------------------
#>  package     * version     date (UTC) lib source
#>  backports     1.4.0       2021-11-23 [1] CRAN (R 4.1.2)
#>  cli           3.1.0       2021-10-27 [1] CRAN (R 4.1.1)
#>  crayon        1.4.2       2021-10-29 [1] CRAN (R 4.1.1)
#>  digest        0.6.28      2021-09-23 [1] CRAN (R 4.1.1)
#>  ellipsis      0.3.2       2021-04-29 [1] CRAN (R 4.1.0)
#>  evaluate      0.14        2019-05-28 [1] CRAN (R 4.1.0)
#>  fansi         0.5.0       2021-05-25 [1] CRAN (R 4.1.0)
#>  fastmap       1.1.0       2021-01-25 [1] CRAN (R 4.1.0)
#>  fs            1.5.0       2020-07-31 [1] CRAN (R 4.1.0)
#>  glue          1.5.0       2021-11-07 [1] CRAN (R 4.1.2)
#>  highr         0.9         2021-04-16 [1] CRAN (R 4.1.0)
#>  htmltools     0.5.2       2021-08-25 [1] CRAN (R 4.1.1)
#>  knitr         1.36        2021-09-29 [1] CRAN (R 4.1.1)
#>  lifecycle     1.0.1       2021-09-24 [1] CRAN (R 4.1.1)
#>  magrittr      2.0.1       2020-11-17 [1] CRAN (R 4.1.0)
#>  pak           0.2.0       2021-12-01 [1] CRAN (R 4.1.2)
#>  pillar        1.6.4       2021-10-18 [1] CRAN (R 4.1.1)
#>  pkgconfig     2.0.3       2019-09-22 [1] CRAN (R 4.1.0)
#>  purrr         0.3.4       2020-04-17 [1] CRAN (R 4.1.0)
#>  R.cache       0.15.0      2021-04-30 [1] CRAN (R 4.1.0)
#>  R.methodsS3   1.8.1       2020-08-26 [1] CRAN (R 4.1.0)
#>  R.oo          1.24.0      2020-08-26 [1] CRAN (R 4.1.0)
#>  R.utils       2.11.0      2021-09-26 [1] CRAN (R 4.1.1)
#>  reprex        2.0.1       2021-08-05 [1] CRAN (R 4.1.0)
#>  rlang         0.99.0.9001 2021-11-29 [1] Github (r-lib/rlang@67da1e1)
#>  rmarkdown     2.11        2021-09-14 [1] CRAN (R 4.1.1)
#>  rstudioapi    0.13        2020-11-12 [1] CRAN (R 4.1.0)
#>  sessioninfo   1.2.1       2021-11-02 [1] CRAN (R 4.1.2)
#>  stringi       1.7.5       2021-10-04 [1] CRAN (R 4.1.1)
#>  stringr       1.4.0       2019-02-10 [1] CRAN (R 4.1.0)
#>  styler        1.6.2       2021-09-23 [1] CRAN (R 4.1.1)
#>  tibble        3.1.6       2021-11-07 [1] CRAN (R 4.1.2)
#>  utf8          1.2.2       2021-07-24 [1] CRAN (R 4.1.0)
#>  vctrs         0.3.8       2021-04-29 [1] CRAN (R 4.1.0)
#>  withr         2.4.2       2021-04-18 [1] CRAN (R 4.1.0)
#>  xfun          0.28        2021-11-04 [1] CRAN (R 4.1.2)
#>  yaml          2.2.1       2020-02-01 [1] CRAN (R 4.1.0)
#> 
#>  [1] C:/Users/liang/Documents/R/win-library/4.1
#>  [2] C:/Program Files/R/R-4.1.2/library
#> 
#> ------------------------------------------------------------------------------

psychelzh avatar Dec 04 '21 05:12 psychelzh

The reason might be that there is no manual dependent data building step, and the compiled data is corrupted for Windows?

psychelzh avatar Dec 04 '21 05:12 psychelzh

Yes, the binary from CRAN is corrupt, unfortunately. You can try to install it from source and then it will create the bundle on your computer:

install.packages("pak", type = "source")

I'll submit a new version to CRAN soon.

gaborcsardi avatar Dec 04 '21 09:12 gaborcsardi

NOTE: Apologies, this wasn't a pak issue but more so a problem with using R with conda. I was able to successfully install pak on Linux using a "normal", non-conda installation of R.

Original post:

Are we sure it's specific to only Windows? I've had the same issue with pak on Linux when installing directly from CRAN:

> install.packages("pak", repos = "https://cloud.r-project.org")
trying URL 'https://cloud.r-project.org/src/contrib/pak_0.2.1.tar.gz'
Content type 'application/x-gzip' length 68695 bytes (67 KB)
==================================================
downloaded 67 KB

* installing *source* package ‘pak’ ...
** package ‘pak’ successfully unpacked and MD5 sums checked
** using staged installation
** R
** data
*** moving datasets to lazyload DB
** building pak dependency data, this can take several minutes
** deps data (37): Failed
** inst
** byte-compile and prepare package for lazy loading
** help
*** installing help indices
** building package indices
** testing if installed package can be loaded from temporary location
** testing if installed package can be loaded from final location
** testing if installed package keeps a record of temporary installation path
* DONE (pak)

The downloaded source packages are in
        ‘/tmp/RtmpovfTI8/downloaded_packages’
Updating HTML index of packages in '.Library'
Making 'packages.html' ... done

And my sessionInfo():

> sessionInfo()
R version 4.1.2 (2021-11-01)
Platform: x86_64-conda-linux-gnu (64-bit)
Running under: Ubuntu 18.04.6 LTS

Matrix products: default
BLAS/LAPACK: /anaconda/envs/rinla/lib/libopenblasp-r0.3.18.so

locale:
 [1] LC_CTYPE=C.UTF-8       LC_NUMERIC=C           LC_TIME=C.UTF-8       
 [4] LC_COLLATE=C.UTF-8     LC_MONETARY=C.UTF-8    LC_MESSAGES=C.UTF-8   
 [7] LC_PAPER=C.UTF-8       LC_NAME=C              LC_ADDRESS=C          
[10] LC_TELEPHONE=C         LC_MEASUREMENT=C.UTF-8 LC_IDENTIFICATION=C   

attached base packages:
[1] stats     graphics  grDevices utils     datasets  methods   base     

loaded via a namespace (and not attached):
 [1] pak_0.2.1       ps_1.6.0        fansi_1.0.2     utf8_1.2.2     
 [5] crayon_1.4.2    R6_2.5.1        lifecycle_1.0.1 magrittr_2.0.1 
 [9] pillar_1.6.4    rlang_0.4.12    cli_3.1.1       callr_3.7.0    
[13] vctrs_0.3.8     ellipsis_0.3.2  tools_4.1.2     glue_1.6.1     
[17] compiler_4.1.2  processx_3.5.2  pkgconfig_2.0.3 tibble_3.1.6 

pak does install when using CRAN, but it gives the same error regarding glue. And, as can be seen, the deps data stage is failing.

If, however, I use the development version, it works properly:

install.packages("pak", repos = "https://r-lib.github.io/p/pak/devel/")

mjkanji avatar Jan 24 '22 18:01 mjkanji

It is strange that install.packages("pak", type = "source") works in my one linux server but not the following one. I tried many times but it does not work. However, install.packages("pak", repos = "https://r-lib.github.io/p/pak/devel/") solved this issue.

> install.packages("pak", type = "source")
Installing package into ‘/home/wangsx/R/x86_64-pc-linux-gnu-library/4.0’
(as ‘lib’ is unspecified)
trying URL 'https://mirrors.bfsu.edu.cn/CRAN/src/contrib/pak_0.3.0.tar.gz'
Content type 'application/octet-stream' length 88564 bytes (86 KB)
==================================================
downloaded 86 KB

* installing *source* package ‘pak’ ...
** package ‘pak’ successfully unpacked and MD5 sums checked
** using staged installation
** R
** data
*** moving datasets to lazyload DB
**** building pak dependency data, this can take several minutes
**** deps data (23): ..........10..........20...23
** inst
** byte-compile and prepare package for lazy loading
** help
*** installing help indices
  converting help for package ‘pak’
    finding HTML links ... done
    cache                                   html  
    handle_package_not_found                html  
    lib_status                              html  
    local_deps                              html  
    local_deps_explain                      html  
    local_install                           html  
    local_install_deps                      html  
    local_install_dev_deps                  html  
    local_package_trees                     html  
    local_system_requirements               html  
    lockfile_create                         html  
    lockfile_install                        html  
    metadata                                html  
    pak                                     html  
    pak_cleanup                             html  
    pak_install_extra                       html  
    pak_package_sources                     html  
    pak_setup                               html  
    pak_sitrep                              html  
    pak_update                              html  
    pkg_deps                                html  
    pkg_deps_explain                        html  
    pkg_deps_tree                           html  
    pkg_download                            html  
    pkg_history                             html  
    pkg_install                             html  
    pkg_name_check                          html  
    pkg_remove                              html  
    pkg_search                              html  
    pkg_status                              html  
    repo_add                                html  
    repo_get                                html  
    repo_status                             html  
** building package indices
** testing if installed package can be loaded from temporary location
** checking absolute paths in shared objects and dynamic libraries
** testing if installed package can be loaded from final location
** testing if installed package keeps a record of temporary installation path
* DONE (pak)

The downloaded source packages are in
	‘/tmp/RtmpLnvjAf/downloaded_packages’
> pak::pkg_install("fastverse")
Error in load_private_package("glue") : 
  Cannot load glue from the private library

Restarting R session...

> pak::pkg_install("fastverse")
Error in load_private_package("glue") : 
  Cannot load glue from the private library
> install.packages("pak", type = "source")
Error in install.packages : Updating loaded packages

Restarting R session...

> install.packages("pak", type = "source")
Installing package into ‘/home/wangsx/R/x86_64-pc-linux-gnu-library/4.0’
(as ‘lib’ is unspecified)
trying URL 'https://mirrors.bfsu.edu.cn/CRAN/src/contrib/pak_0.3.0.tar.gz'
Content type 'application/octet-stream' length 88564 bytes (86 KB)
==================================================
downloaded 86 KB

* installing *source* package ‘pak’ ...
** package ‘pak’ successfully unpacked and MD5 sums checked
** using staged installation
** R
** data
*** moving datasets to lazyload DB
**** building pak dependency data, this can take several minutes
**** deps data (23): ..........10..........20...23
** inst
** byte-compile and prepare package for lazy loading
** help
*** installing help indices
  converting help for package ‘pak’
    finding HTML links ... done
    cache                                   html  
    handle_package_not_found                html  
    lib_status                              html  
    local_deps                              html  
    local_deps_explain                      html  
    local_install                           html  
    local_install_deps                      html  
    local_install_dev_deps                  html  
    local_package_trees                     html  
    local_system_requirements               html  
    lockfile_create                         html  
    lockfile_install                        html  
    metadata                                html  
    pak                                     html  
    pak_cleanup                             html  
    pak_install_extra                       html  
    pak_package_sources                     html  
    pak_setup                               html  
    pak_sitrep                              html  
    pak_update                              html  
    pkg_deps                                html  
    pkg_deps_explain                        html  
    pkg_deps_tree                           html  
    pkg_download                            html  
    pkg_history                             html  
    pkg_install                             html  
    pkg_name_check                          html  
    pkg_remove                              html  
    pkg_search                              html  
    pkg_status                              html  
    repo_add                                html  
    repo_get                                html  
    repo_status                             html  
** building package indices
** testing if installed package can be loaded from temporary location
** checking absolute paths in shared objects and dynamic libraries
** testing if installed package can be loaded from final location
** testing if installed package keeps a record of temporary installation path
* DONE (pak)

The downloaded source packages are in
	‘/tmp/RtmpfoDGJA/downloaded_packages’
> pak::pkg_install("fastverse")
Error in load_private_package("glue") : 
  Cannot load glue from the private library
> sessioninfo::session_info()
─ Session info ──────────────────────────────────────────────────────────────────────────────────────────
 setting  value
 version  R version 4.0.1 (2020-06-06)
 os       CentOS Linux 7 (Core)
 system   x86_64, linux-gnu
 ui       RStudio
 language (EN)
 collate  en_US.UTF-8
 ctype    en_US.UTF-8
 tz       Asia/Shanghai
 date     2022-04-25
 rstudio  1.3.959 Middlemist Red (server)
 pandoc   NA

─ Packages ──────────────────────────────────────────────────────────────────────────────────────────────
 package     * version date (UTC) lib source
 cli           3.2.0   2022-02-14 [1] CRAN (R 4.0.1)
 pak           0.3.0   2022-04-11 [1] CRAN (R 4.0.1)
 sessioninfo   1.2.2   2021-12-06 [1] CRAN (R 4.0.1)

 [1] /home/wangsx/R/x86_64-pc-linux-gnu-library/4.0
 [2] /opt/R/4.0.1/lib/R/library

ShixiangWang avatar Apr 25 '22 08:04 ShixiangWang

@ShixiangWang that is weird indeed. Can you try another mirror, just to rule out a broken mirror?

gaborcsardi avatar Apr 25 '22 08:04 gaborcsardi

I tried another mirror, the same problem. @gaborcsardi

> remove.packages("pak")
Removing package from ‘/home/wangsx/R/x86_64-pc-linux-gnu-library/4.0’
(as ‘lib’ is unspecified)
> install.packages("pak", repos = "http://cran.us.r-project.org", type = "source")
Installing package into ‘/home/wangsx/R/x86_64-pc-linux-gnu-library/4.0’
(as ‘lib’ is unspecified)
trying URL 'http://cran.us.r-project.org/src/contrib/pak_0.3.0.tar.gz'
Content type 'application/x-gzip' length 88564 bytes (86 KB)
==================================================
downloaded 86 KB

-- Attaching packages --------------------------------------- fastverse 0.2.3 --
v data.table  1.14.2     v collapse    1.7.6 
v magrittr    2.0.3      v matrixStats 0.61.0
v kit         0.0.11     v fst         0.9.8 
* installing *source* package ‘pak’ ...
** package ‘pak’ successfully unpacked and MD5 sums checked
** using staged installation
** R
** data
*** moving datasets to lazyload DB
**** building pak dependency data, this can take several minutes
**** deps data (23): ..........10..........20...23
** inst
** byte-compile and prepare package for lazy loading
-- Attaching packages --------------------------------------- fastverse 0.2.3 --
v data.table  1.14.2     v collapse    1.7.6 
v magrittr    2.0.3      v matrixStats 0.61.0
v kit         0.0.11     v fst         0.9.8 
** help
*** installing help indices
  converting help for package ‘pak’
    finding HTML links ... done
    cache                                   html  
    handle_package_not_found                html  
    lib_status                              html  
    local_deps                              html  
    local_deps_explain                      html  
    local_install                           html  
    local_install_deps                      html  
    local_install_dev_deps                  html  
    local_package_trees                     html  
    local_system_requirements               html  
    lockfile_create                         html  
    lockfile_install                        html  
    metadata                                html  
    pak                                     html  
    pak_cleanup                             html  
    pak_install_extra                       html  
    pak_package_sources                     html  
    pak_setup                               html  
    pak_sitrep                              html  
    pak_update                              html  
    pkg_deps                                html  
    pkg_deps_explain                        html  
    pkg_deps_tree                           html  
    pkg_download                            html  
    pkg_history                             html  
    pkg_install                             html  
    pkg_name_check                          html  
    pkg_remove                              html  
    pkg_search                              html  
    pkg_status                              html  
    repo_add                                html  
    repo_get                                html  
    repo_status                             html  
** building package indices
-- Attaching packages --------------------------------------- fastverse 0.2.3 --
v data.table  1.14.2     v collapse    1.7.6 
v magrittr    2.0.3      v matrixStats 0.61.0
v kit         0.0.11     v fst         0.9.8 
** testing if installed package can be loaded from temporary location
-- Attaching packages --------------------------------------- fastverse 0.2.3 --
v data.table  1.14.2     v collapse    1.7.6 
v magrittr    2.0.3      v matrixStats 0.61.0
v kit         0.0.11     v fst         0.9.8 
** checking absolute paths in shared objects and dynamic libraries
** testing if installed package can be loaded from final location
-- Attaching packages --------------------------------------- fastverse 0.2.3 --
v data.table  1.14.2     v collapse    1.7.6 
v magrittr    2.0.3      v matrixStats 0.61.0
v kit         0.0.11     v fst         0.9.8 
** testing if installed package keeps a record of temporary installation path
* DONE (pak)

The downloaded source packages are in
	‘/tmp/RtmpIRoGU7/downloaded_packages’
> pak::pkg_install("dplyr")
Error in load_private_package("glue") : 
  Cannot load glue from the private library

ShixiangWang avatar Apr 25 '22 08:04 ShixiangWang

The second approach still works.

> install.packages("pak", repos = "https://r-lib.github.io/p/pak/devel/")
Installing package into ‘/home/wangsx/R/x86_64-pc-linux-gnu-library/4.0’
(as ‘lib’ is unspecified)
trying URL 'https://r-lib.github.io/p/pak/devel/src/contrib/../../linux/x86_64/pak_0.3.0.9000_R-4-0_x86_64-linux.tar.gz'
Content type 'application/gzip' length 7640747 bytes (7.3 MB)
==================================================
downloaded 7.3 MB

-- Attaching packages --------------------------------------- fastverse 0.2.3 --
v data.table  1.14.2     v collapse    1.7.6 
v magrittr    2.0.3      v matrixStats 0.61.0
v kit         0.0.11     v fst         0.9.8 
* installing *binary* package ‘pak’ ...
* DONE (pak)

The downloaded source packages are in
	‘/tmp/RtmpzV1YsJ/downloaded_packages’
> pak::pkg_install("dplyr")
✓ Loading metadata database ... done
                                                                          
ℹ No downloads are needed
✓ 1 pkg + 17 deps: kept 17 [5.4s]

ShixiangWang avatar Apr 25 '22 08:04 ShixiangWang

@ShixiangWang I can't reproduce this, unfortunately.

It seems that you are loading some packages from .Rprofile, can you to omit remove this from your profile, temporarily? Just to see if this is causing any trouble.

gaborcsardi avatar Apr 25 '22 12:04 gaborcsardi

@gaborcsardi Thanks. I comment all lines in ~/.Rprofile and ~/.R/Makevars. It works.

> remove.packages("pak")
Removing package from ‘/home/wangsx/R/x86_64-pc-linux-gnu-library/4.0’
(as ‘lib’ is unspecified)
> install.packages("pak", repos = "http://cran.us.r-project.org", type = "source")
Installing package into ‘/home/wangsx/R/x86_64-pc-linux-gnu-library/4.0’
(as ‘lib’ is unspecified)
trying URL 'http://cran.us.r-project.org/src/contrib/pak_0.3.0.tar.gz'
Content type 'application/x-gzip' length 88564 bytes (86 KB)
==================================================
downloaded 86 KB

* installing *source* package ‘pak’ ...
** package ‘pak’ successfully unpacked and MD5 sums checked
** using staged installation
** R
** data
*** moving datasets to lazyload DB
**** building pak dependency data, this can take several minutes
**** deps data (23): ..........10..........20...23
** inst
** byte-compile and prepare package for lazy loading
** help
*** installing help indices
  converting help for package ‘pak’
    finding HTML links ... done
    cache                                   html  
    handle_package_not_found                html  
    lib_status                              html  
    local_deps                              html  
    local_deps_explain                      html  
    local_install                           html  
    local_install_deps                      html  
    local_install_dev_deps                  html  
    local_package_trees                     html  
    local_system_requirements               html  
    lockfile_create                         html  
    lockfile_install                        html  
    metadata                                html  
    pak                                     html  
    pak_cleanup                             html  
    pak_install_extra                       html  
    pak_package_sources                     html  
    pak_setup                               html  
    pak_sitrep                              html  
    pak_update                              html  
    pkg_deps                                html  
    pkg_deps_explain                        html  
    pkg_deps_tree                           html  
    pkg_download                            html  
    pkg_history                             html  
    pkg_install                             html  
    pkg_name_check                          html  
    pkg_remove                              html  
    pkg_search                              html  
    pkg_status                              html  
    repo_add                                html  
    repo_get                                html  
    repo_status                             html  
** building package indices
** testing if installed package can be loaded from temporary location
** checking absolute paths in shared objects and dynamic libraries
** testing if installed package can be loaded from final location
** testing if installed package keeps a record of temporary installation path
* DONE (pak)

The downloaded source packages are in
	‘/tmp/RtmpPzadxa/downloaded_packages’
> pak::pkg_install("dplyr")
⠋ Updating metadata database [0/6] | Downloading [0 B / 0 B]              
 Found  Updating metadata database ... done                                     
                                                                            
ℹ No downloads are needed
✔ 1 pkg + 17 deps: kept 16 [23.7s]

~/.Rprofile

old_path = Sys.getenv("PATH")
Sys.setenv(PATH = paste(old_path, "~/miniconda3/bin/", sep = ":"))

options(BioC_mirror="https://mirrors.bfsu.edu.cn/bioconductor")
options("repos" = c(CRAN="https://mirrors.bfsu.edu.cn/CRAN/"))

library(usethis)
library(skimr)
library(fastverse)
library(ggplot2)

Makevars

CXX11=/opt/rh/devtoolset-9/root/usr/bin/g++ -std=c++11 -fPIC
CXX14=/opt/rh/devtoolset-9/root/usr/bin/g++ -std=c++14 -fPIC

ShixiangWang avatar Apr 26 '22 01:04 ShixiangWang

Thanks, this is really useful! Can you please try one a couple of more things, to pin this down?

Can you install glue from source? (With your profile and env file.)

Can you try one commenting out only Makevars and install pak from source?

Can you try commenting out only the miniconda path line, and install pak from source?

Thanks very much!

gaborcsardi avatar Apr 26 '22 07:04 gaborcsardi

I cannot reinstall glue in case 1 as the .Rprofile loaded it.

> install.packages("glue")
Installing package into ‘/home/wangsx/R/x86_64-pc-linux-gnu-library/4.0’
(as ‘lib’ is unspecified)
trying URL 'https://mirrors.bfsu.edu.cn/CRAN/src/contrib/glue_1.6.2.tar.gz'
Content type 'application/octet-stream' length 106510 bytes (104 KB)
==================================================
downloaded 104 KB

-- Attaching packages --------------------------------------- fastverse 0.2.3 --
v data.table  1.14.2     v collapse    1.7.6 
v magrittr    2.0.3      v matrixStats 0.61.0
v kit         0.0.11     v fst         0.9.8 
* installing *source* package ‘glue’ ...
** package ‘glue’ successfully unpacked and MD5 sums checked
** using staged installation
** libs
gcc -std=gnu99 -I"/opt/R/4.0.1/lib/R/include" -DNDEBUG   -I/usr/local/include   -fpic  -g -O2  -c glue.c -o glue.o
gcc -std=gnu99 -I"/opt/R/4.0.1/lib/R/include" -DNDEBUG   -I/usr/local/include   -fpic  -g -O2  -c init.c -o init.o
gcc -std=gnu99 -I"/opt/R/4.0.1/lib/R/include" -DNDEBUG   -I/usr/local/include   -fpic  -g -O2  -c trim.c -o trim.o
gcc -std=gnu99 -shared -L/opt/R/4.0.1/lib/R/lib -L/usr/local/lib -o glue.so glue.o init.o trim.o -L/opt/R/4.0.1/lib/R/lib -lR
installing to /home/wangsx/R/x86_64-pc-linux-gnu-library/4.0/00LOCK-glue/00new/glue/libs
** R
** inst
** byte-compile and prepare package for lazy loading
-- Attaching packages --------------------------------------- fastverse 0.2.3 --
v data.table  1.14.2     v collapse    1.7.6 
v magrittr    2.0.3      v matrixStats 0.61.0
v kit         0.0.11     v fst         0.9.8 
Error in unloadNamespace("glue") : 
  namespace ‘glue’ is imported by ‘usethis’, ‘ggplot2’, ‘tidyselect’, ‘dplyr’, ‘pillar’ so cannot be unloaded
Execution halted
ERROR: lazy loading failed for package ‘glue’
* removing ‘/home/wangsx/R/x86_64-pc-linux-gnu-library/4.0/glue’
* restoring previous ‘/home/wangsx/R/x86_64-pc-linux-gnu-library/4.0/glue’
Warning in install.packages :
  installation of package ‘glue’ had non-zero exit status

The downloaded source packages are in
	‘/tmp/RtmpzgG8Fu/downloaded_packages’

Case 2, comment the Makevars. Same as previous, dont work anymore.

> install.packages("pak", type = "source")
Installing package into ‘/home/wangsx/R/x86_64-pc-linux-gnu-library/4.0’
(as ‘lib’ is unspecified)
trying URL 'https://mirrors.bfsu.edu.cn/CRAN/src/contrib/pak_0.3.0.tar.gz'
Content type 'application/octet-stream' length 88564 bytes (86 KB)
==================================================
downloaded 86 KB

-- Attaching packages --------------------------------------- fastverse 0.2.3 --
v data.table  1.14.2     v collapse    1.7.6 
v magrittr    2.0.3      v matrixStats 0.61.0
v kit         0.0.11     v fst         0.9.8 
* installing *source* package ‘pak’ ...
** package ‘pak’ successfully unpacked and MD5 sums checked
** using staged installation
** R
** data
*** moving datasets to lazyload DB
**** building pak dependency data, this can take several minutes
**** deps data (23): ..........10..........20...23
** inst
** byte-compile and prepare package for lazy loading
-- Attaching packages --------------------------------------- fastverse 0.2.3 --
v data.table  1.14.2     v collapse    1.7.6 
v magrittr    2.0.3      v matrixStats 0.61.0
v kit         0.0.11     v fst         0.9.8 
** help
*** installing help indices
  converting help for package ‘pak’
    finding HTML links ... done
    cache                                   html  
    handle_package_not_found                html  
    lib_status                              html  
    local_deps                              html  
    local_deps_explain                      html  
    local_install                           html  
    local_install_deps                      html  
    local_install_dev_deps                  html  
    local_package_trees                     html  
    local_system_requirements               html  
    lockfile_create                         html  
    lockfile_install                        html  
    metadata                                html  
    pak                                     html  
    pak_cleanup                             html  
    pak_install_extra                       html  
    pak_package_sources                     html  
    pak_setup                               html  
    pak_sitrep                              html  
    pak_update                              html  
    pkg_deps                                html  
    pkg_deps_explain                        html  
    pkg_deps_tree                           html  
    pkg_download                            html  
    pkg_history                             html  
    pkg_install                             html  
    pkg_name_check                          html  
    pkg_remove                              html  
    pkg_search                              html  
    pkg_status                              html  
    repo_add                                html  
    repo_get                                html  
    repo_status                             html  
** building package indices
-- Attaching packages --------------------------------------- fastverse 0.2.3 --
v data.table  1.14.2     v collapse    1.7.6 
v magrittr    2.0.3      v matrixStats 0.61.0
v kit         0.0.11     v fst         0.9.8 
** testing if installed package can be loaded from temporary location
-- Attaching packages --------------------------------------- fastverse 0.2.3 --
v data.table  1.14.2     v collapse    1.7.6 
v magrittr    2.0.3      v matrixStats 0.61.0
v kit         0.0.11     v fst         0.9.8 
** checking absolute paths in shared objects and dynamic libraries
** testing if installed package can be loaded from final location
-- Attaching packages --------------------------------------- fastverse 0.2.3 --
v data.table  1.14.2     v collapse    1.7.6 
v magrittr    2.0.3      v matrixStats 0.61.0
v kit         0.0.11     v fst         0.9.8 
** testing if installed package keeps a record of temporary installation path
* DONE (pak)

The downloaded source packages are in
	‘/tmp/RtmpYU6Qbc/downloaded_packages’

> pak::pkg_install("dplyr")
Error in load_private_package("glue") : 
  Cannot load glue from the private library

Case 3, comment out PATH update (remove conda to path). Same as above.

Case 4, comment the library loading, works!

#old_path = Sys.getenv("PATH")
#Sys.setenv(PATH = paste(old_path, "~/miniconda3/bin/", sep = ":"))

options(BioC_mirror="https://mirrors.bfsu.edu.cn/bioconductor")
options("repos" = c(CRAN="https://mirrors.bfsu.edu.cn/CRAN/"))

# library(usethis)
# library(skimr)
# library(fastverse)
# library(ggplot2)
> install.packages("pak", type = "source")
Installing package into ‘/home/wangsx/R/x86_64-pc-linux-gnu-library/4.0’
(as ‘lib’ is unspecified)
trying URL 'https://mirrors.bfsu.edu.cn/CRAN/src/contrib/pak_0.3.0.tar.gz'
Content type 'application/octet-stream' length 88564 bytes (86 KB)
==================================================
downloaded 86 KB

* installing *source* package ‘pak’ ...
** package ‘pak’ successfully unpacked and MD5 sums checked
** using staged installation
** R
** data
*** moving datasets to lazyload DB
**** building pak dependency data, this can take several minutes
**** deps data (23): ..........10..........20...23
** inst
** byte-compile and prepare package for lazy loading
** help
*** installing help indices
  converting help for package ‘pak’
    finding HTML links ... done
    cache                                   html  
    handle_package_not_found                html  
    lib_status                              html  
    local_deps                              html  
    local_deps_explain                      html  
    local_install                           html  
    local_install_deps                      html  
    local_install_dev_deps                  html  
    local_package_trees                     html  
    local_system_requirements               html  
    lockfile_create                         html  
    lockfile_install                        html  
    metadata                                html  
    pak                                     html  
    pak_cleanup                             html  
    pak_install_extra                       html  
    pak_package_sources                     html  
    pak_setup                               html  
    pak_sitrep                              html  
    pak_update                              html  
    pkg_deps                                html  
    pkg_deps_explain                        html  
    pkg_deps_tree                           html  
    pkg_download                            html  
    pkg_history                             html  
    pkg_install                             html  
    pkg_name_check                          html  
    pkg_remove                              html  
    pkg_search                              html  
    pkg_status                              html  
    repo_add                                html  
    repo_get                                html  
    repo_status                             html  
** building package indices
** testing if installed package can be loaded from temporary location
** checking absolute paths in shared objects and dynamic libraries
** testing if installed package can be loaded from final location
** testing if installed package keeps a record of temporary installation path
* DONE (pak)

The downloaded source packages are in
	‘/tmp/RtmpNCVpbr/downloaded_packages’
> pak::pkg_install("dplyr")
⠋ Updating metadata database [0/6] | Downloading [0 B / 0 B]              
 Found  Updating metadata database ... done                                     
                                                                            
ℹ No downloads are needed
✔ 1 pkg + 17 deps: kept 16 [24.2s]

ShixiangWang avatar Apr 27 '22 10:04 ShixiangWang

Great, thank you, this is invaluable! There is a chance that I can fix this, but if not, then we could at least give a better error message.

gaborcsardi avatar Apr 27 '22 10:04 gaborcsardi

You're welcome. Wait the better pak! :)

ShixiangWang avatar Apr 27 '22 11:04 ShixiangWang

Btw. it is not great to unconditionally load packages in .Rprofile. This is why you cannot even install glue, because the installer process also loads the profile, and then R tries to unload glue, but can't because other packages depend on it.

The installer process probably should not load any packages, but this something that you or I can fix.

One way to work around this is to check for the environment variable that is always set for the install:

if (Sys.getenv("R_INSTALL_PKG") == "") {
  library(usethis)
  library(skimr)
  library(fastverse)
  library(ggplot2)
}

gaborcsardi avatar Apr 27 '22 11:04 gaborcsardi

@gaborcsardi Thanks, I don't know such way before 👍

ShixiangWang avatar Apr 27 '22 12:04 ShixiangWang