sjmgarnier / viridis

Colorblind-Friendly Color Maps for R
http://sjmgarnier.github.io/viridis
Other
294 stars 38 forks source link

Error : unable to load R code in package ‘viridis’ #57

Closed eoli3n closed 6 years ago

eoli3n commented 6 years ago

I can't install DESeq2 because viridis deps fails installing.

> source("https://bioconductor.org/biocLite.R")
Bioconductor version 3.6 (BiocInstaller 1.28.0), ?biocLite for help
> biocLite("DESeq2")
BioC_mirror: https://bioconductor.org
Using Bioconductor 3.6 (BiocInstaller 1.28.0), R 3.4.4 (2018-03-15).
Installing package(s) ‘DESeq2’
also installing the dependencies ‘viridis’, ‘Hmisc’

essai de l'URL 'https://cloud.r-project.org/src/contrib/viridis_0.5.1.tar.gz'
Content type 'application/x-gzip' length 1906320 bytes (1.8 MB)
==================================================
downloaded 1.8 MB

essai de l'URL 'https://cloud.r-project.org/src/contrib/Hmisc_4.1-1.tar.gz'
Content type 'application/x-gzip' length 711786 bytes (695 KB)
==================================================
downloaded 695 KB

essai de l'URL 'https://bioconductor.org/packages/3.6/bioc/src/contrib/DESeq2_1.18.1.tar.gz'
Content type 'application/x-gzip' length 2139692 bytes (2.0 MB)
==================================================
downloaded 2.0 MB

* installing *source* package ‘viridis’ ...
** package ‘viridis’ correctement décompressé et sommes MD5 vérifiées
** R
** inst
** preparing package for lazy loading
Error : 'viridis.map' is not an exported object from 'namespace:viridisLite'
Error : unable to load R code in package ‘viridis’
ERROR: lazy loading failed for package ‘viridis’
* removing ‘/net/apps/R-packages/viridis’
ERROR: dependency ‘viridis’ is not available for package ‘Hmisc’
* removing ‘/net/apps/R-packages/Hmisc’
ERROR: dependency ‘Hmisc’ is not available for package ‘DESeq2’
* removing ‘/net/apps/R-packages/DESeq2’

The downloaded source packages are in
    ‘/tmp/RtmpqerE0F/downloaded_packages’
Warning messages:
1: In install.packages(pkgs = doing, lib = lib, ...) :
  installation of package ‘viridis’ had non-zero exit status
2: In install.packages(pkgs = doing, lib = lib, ...) :
  installation of package ‘Hmisc’ had non-zero exit status
3: In install.packages(pkgs = doing, lib = lib, ...) :
  installation of package ‘DESeq2’ had non-zero exit status
> install.packages("viridisLite")
Installation du package dans ‘/net/apps/R-packages’
(car ‘lib’ n'est pas spécifié)
essai de l'URL 'https://cloud.r-project.org/src/contrib/viridisLite_0.3.0.tar.gz'
Content type 'application/x-gzip' length 44019 bytes (42 KB)
==================================================
downloaded 42 KB

* installing *source* package ‘viridisLite’ ...
** package ‘viridisLite’ correctement décompressé et sommes MD5 vérifiées
** R
** data
*** moving datasets to lazyload DB
** preparing package for lazy loading
** help
*** installing help indices
*** copying figures
** building package indices
** testing if installed package can be loaded
* DONE (viridisLite)

Les packages source téléchargés sont dans
    ‘/tmp/RtmpqerE0F/downloaded_packages’
> install.packages("viridis")
Installation du package dans ‘/net/apps/R-packages’
(car ‘lib’ n'est pas spécifié)
essai de l'URL 'https://cloud.r-project.org/src/contrib/viridis_0.5.1.tar.gz'
Content type 'application/x-gzip' length 1906320 bytes (1.8 MB)
==================================================
downloaded 1.8 MB

* installing *source* package ‘viridis’ ...
** package ‘viridis’ correctement décompressé et sommes MD5 vérifiées
** R
** inst
** preparing package for lazy loading
Error : 'viridis.map' is not an exported object from 'namespace:viridisLite'
Error : unable to load R code in package ‘viridis’
ERROR: lazy loading failed for package ‘viridis’
* removing ‘/net/apps/R-packages/viridis’

Les packages source téléchargés sont dans
    ‘/tmp/RtmpqerE0F/downloaded_packages’
Warning message:
In install.packages("viridis") :
  l'installation du package ‘viridis’ a eu un statut de sortie non nul
sjmgarnier commented 6 years ago

I cannot reproduce this here. What's the output of install.packages("viridis")? Also, what is your system configuration, R version, etc.?

eoli3n commented 6 years ago

What's the output of install.packages("viridis")? Please read my paste.

At home right now, but i will give you R version monday.

sjmgarnier commented 6 years ago

@eoli3n Would you happen to have multiple versions of viridisLite installed?

eoli3n commented 6 years ago
R --version
R version 3.4.4 (2018-03-15)
> remove.packages("viridisLite")
Elimination du package de ‘/net/apps/R-packages’
(car ‘lib’ n'est pas spécifié)
> remove.packages("viridisLite")
Elimination du package de ‘/net/apps/R-packages’
(car ‘lib’ n'est pas spécifié)
Error in find.package(pkgs, lib) : 
  there is no package called ‘viridisLite’
> install.packages("viridisLite")
Installation du package dans ‘/net/apps/R-packages’
(car ‘lib’ n'est pas spécifié)
essai de l'URL 'https://cloud.r-project.org/src/contrib/viridisLite_0.3.0.tar.gz'
Content type 'application/x-gzip' length 44019 bytes (42 KB)
==================================================
downloaded 42 KB

* installing *source* package ‘viridisLite’ ...
** package ‘viridisLite’ correctement décompressé et sommes MD5 vérifiées
** R
** data
*** moving datasets to lazyload DB
** preparing package for lazy loading
** help
*** installing help indices
*** copying figures
** building package indices
** testing if installed package can be loaded
* DONE (viridisLite)

Les packages source téléchargés sont dans
    ‘/tmp/RtmpqerE0F/downloaded_packages’
> install.packages("viridis")
Installation du package dans ‘/net/apps/R-packages’
(car ‘lib’ n'est pas spécifié)
essai de l'URL 'https://cloud.r-project.org/src/contrib/viridis_0.5.1.tar.gz'
Content type 'application/x-gzip' length 1906320 bytes (1.8 MB)
==================================================
downloaded 1.8 MB

* installing *source* package ‘viridis’ ...
** package ‘viridis’ correctement décompressé et sommes MD5 vérifiées
** R
** inst
** preparing package for lazy loading
Error : 'viridis.map' is not an exported object from 'namespace:viridisLite'
Error : unable to load R code in package ‘viridis’
ERROR: lazy loading failed for package ‘viridis’
* removing ‘/net/apps/R-packages/viridis’

Les packages source téléchargés sont dans
    ‘/tmp/RtmpqerE0F/downloaded_packages’
Warning message:
In install.packages("viridis") :
  l'installation du package ‘viridis’ a eu un statut de sortie non nul
eoli3n commented 6 years ago

I use a specific lib path, could it be the problem ?

sjmgarnier commented 6 years ago

@eoli3n What's your system configuration? I need to know which operating system you're working on. The R version is not enough.

Also, remove viridis and viridisLite and restart R. Then test if there are remaining installations of viridis and viridisLite using library(viridis) and library(viridisLite). They should both return errors. If this is the case, install viridis and viridis only. Do not install viridisLite first.

I don't see why a specific lib path would be creating this problem, but you could also try with the default lib path.

eoli3n commented 6 years ago

Ubuntu 16.04.

Your procedure worked.

root@xenial:~# R

R version 3.4.4 (2018-03-15) -- "Someone to Lean On"
Copyright (C) 2018 The R Foundation for Statistical Computing
Platform: x86_64-pc-linux-gnu (64-bit)

R est un logiciel libre livré sans AUCUNE GARANTIE.
Vous pouvez le redistribuer sous certaines conditions.
Tapez 'license()' ou 'licence()' pour plus de détails.

R est un projet collaboratif avec de nombreux contributeurs.
Tapez 'contributors()' pour plus d'information et
'citation()' pour la façon de le citer dans les publications.

Tapez 'demo()' pour des démonstrations, 'help()' pour l'aide
en ligne ou 'help.start()' pour obtenir l'aide au format HTML.
Tapez 'q()' pour quitter R.

> remove.packages("viridis")
Elimination du package de ‘/net/apps/R-packages’
(car ‘lib’ n'est pas spécifié)
Error in find.package(pkgs, lib) : there is no package called ‘viridis’
> remove.packages("viridisLite")
Elimination du package de ‘/net/apps/R-packages’
(car ‘lib’ n'est pas spécifié)
> library("viridis")
Error in library("viridis") : aucun package nommé ‘viridis’ n'est trouvé
> library("viridisLite")
Error in library("viridisLite") : 
  aucun package nommé ‘viridisLite’ n'est trouvé
> install.packages("viridis")
Installation du package dans ‘/net/apps/R-packages’
(car ‘lib’ n'est pas spécifié)
installation de la dépendance ‘viridisLite’

essai de l'URL 'https://cloud.r-project.org/src/contrib/viridisLite_0.3.0.tar.gz'
Content type 'application/x-gzip' length 44019 bytes (42 KB)
==================================================
downloaded 42 KB

essai de l'URL 'https://cloud.r-project.org/src/contrib/viridis_0.5.1.tar.gz'
Content type 'application/x-gzip' length 1906320 bytes (1.8 MB)
==================================================
downloaded 1.8 MB

* installing *source* package ‘viridisLite’ ...
** package ‘viridisLite’ correctement décompressé et sommes MD5 vérifiées
** R
** data
*** moving datasets to lazyload DB
** preparing package for lazy loading
** help
*** installing help indices
*** copying figures
** building package indices
** testing if installed package can be loaded
* DONE (viridisLite)
* installing *source* package ‘viridis’ ...
** package ‘viridis’ correctement décompressé et sommes MD5 vérifiées
** R
** inst
** preparing package for lazy loading
** help
*** installing help indices
*** copying figures
** building package indices
** installing vignettes
** testing if installed package can be loaded
* DONE (viridis)

Les packages source téléchargés sont dans
    ‘/tmp/RtmpF6GPLI/downloaded_packages’
sjmgarnier commented 6 years ago

@eoli3n Good to hear! Though this is still a bit strange. It should have worked the way you did it the first time. I'll see if anybody else reports this problem.

Flamefire commented 4 years ago

@sjmgarnier We are seeing the same problem on R 3.6.0 when installing viridislit 0.3.0 and then viridis 0.5.1 on a Power system. This might have worked before but we actually build in (pretty) clean environments so no idea what can cause this.

We must install viridislite first as no Downloads at install time should happen. Any ideas?

jens-maus commented 4 years ago

@sjmgarnier I am having the same issue here in a R 4.0.2 environment. Your metioned procedure (https://github.com/sjmgarnier/viridis/issues/57#issuecomment-381570140) doesn't seem to work here as the Error : 'viridis.map' is not an exported object from 'namespace:viridisLite'error always happens even if I install only the 'viridis' package which then downloads 'viridisLite' itself and installs it before viridis. Haven't found a way here yet to workaround this issue, thought.

jens-maus commented 4 years ago

@sjmgarnier It seems something is wrong with the viridisLite package sind the viridis.map object is really not exported so that your viridis package can use it during package install:

R version 4.0.2 (2020-06-22) -- "Taking Off Again"
Copyright (C) 2020 The R Foundation for Statistical Computing
Platform: x86_64-pc-linux-gnu (64-bit)

R is free software and comes with ABSOLUTELY NO WARRANTY.
You are welcome to redistribute it under certain conditions.
Type 'license()' or 'licence()' for distribution details.

  Natural language support but running in an English locale

R is a collaborative project with many contributors.
Type 'contributors()' for more information and
'citation()' on how to cite R or R packages in publications.

Type 'demo()' for some demos, 'help()' for on-line help, or
'help.start()' for an HTML browser interface to help.
Type 'q()' to quit R.

R> library(viridisLite)
R> viridisLite::
viridisLite::plasma   viridisLite::inferno  viridisLite::magma    viridisLite::cividis  viridisLite::viridis  
R> viridisLite::viridis.map
Error: 'viridis.map' is not an exported object from 'namespace:viridisLite'
jens-maus commented 4 years ago

Ok, after further investigation, I think I have identified the root cause. See here: https://github.com/sjmgarnier/viridisLite/issues/17

Flamefire commented 4 years ago

@jens-maus So the essence is that --no-data causes it to fail? For us we are using R CMD INSTALL /sw/R/extensions/viridisLite_0.3.0.tar.gz --library=/sw/installed/R/lib64/R/library --no-clean-on-error and I see

* installing *source* package viridisLite ...
** Paket viridisLite erfolgreich entpackt und MD5 Summen berprft
** using staged installation
** R
** data
*** moving datasets to lazyload DB
** byte-compile and prepare package for lazy loading
** help
*** installing help indices
*** copying figures
** 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 (viridisLite)

So I guess that is not the same cause?

jens-maus commented 4 years ago

@Flamefire See my recipie here: https://github.com/sjmgarnier/viridisLite/issues/17#issuecomment-684884029 You explicitly have to specify --data to get the data installed during virdisLite installation so that viridis.map exists afterwards when you install the viridis package.

Flamefire commented 4 years ago

I just checked that again as I have 2 machines with exact same install procedure as above with same output. On the x86 machine it works (no --data required) and on the power machine it does not work

The difference I see is when checking the lib64/R/library/viridisLite/data folder:

Again: The power machine with the viridis.map.rda is the one where viridis.map is not found O.o

Flamefire commented 4 years ago

@jens-maus I just tried this: R CMD INSTALL <path-to>/viridisLite --library=/R/lib64/R/library --no-clean-on-error --data and I get

Warning: unknown option --data

And indeed --help shows no such option. Only --no-data suggesting that installing the data is already the default

Flamefire commented 4 years ago

Turns out that for me this was a file system issue and installation via R CMD INSTALL into a different file system and without --data (which is the default but not a valid option) works as expected for R 3.x (and others report success for 4.0 too)