mlr-org / mlr3verse

Meta-package for installing/updating mlr3* packages.
https://mlr3verse.mlr-org.com
GNU Lesser General Public License v3.0
49 stars 6 forks source link

error when loading mlr3verse: #9

Closed drag05 closed 4 years ago

drag05 commented 4 years ago

I have this error message when loading mlr3verse:

require(mlr3verse)

Loading required package: mlr3verse
Loading required package: mlr3
Loading required package: mlr3filters
Loading required package: mlr3learners
Loading required package: mlr3pipelines
Loading required package: mlr3tuning
Error: package or namespace load failed for ‘mlr3tuning’ in namespaceExport(ns, exports):
 undefined exports: trm
Failed with error:  ‘package ‘mlr3tuning’ could not be loaded’

Since it had worked before, I re-installed mlr3verse and then mlr3tuning separately to no avail. Please advise

Thank you!

pat-s commented 4 years ago

I'd say reinstalling mlr3tuning and then restarting the session should help.

If not, please provide a reprex.

drag05 commented 4 years ago

@pat-s Hello, Thank you for replay! As I have mentioned above I have already re-installed mlr3tuning and mlr3verse. As advised, I am re-installing mlr3tuning again. Here is what happens:

> require(mlr3verse)
Loading required package: mlr3verse
Loading required package: mlr3
Loading required package: mlr3filters
Loading required package: mlr3learners
Loading required package: mlr3pipelines
Loading required package: mlr3tuning
Error: package or namespace load failed for ‘mlr3tuning’ in namespaceExport(ns, exports):
 undefined exports: trm
Failed with error:  ‘package ‘mlr3tuning’ could not be loaded’

> packageVersion("mlr3tuning")
[1] ‘0.2.0’
> packageVersion("mlr3verse")
[1] ‘0.1.3’
> install.packages("mlr3tuning")
trying URL 'http://cran.rstudio.com/bin/windows/contrib/4.0/mlr3tuning_0.2.0.zip'
Content type 'application/zip' length 438072 bytes (427 KB)
downloaded 427 KB

package ‘mlr3tuning’ successfully unpacked and MD5 sums checked

The downloaded binary packages are in
    C:\Users\...\Temp\RtmpUZ7YA4\downloaded_packages

> packageVersion("mlr3tuning")

[1] ‘0.2.0’

Restarting R session...

> require(mlr3verse)
Loading required package: mlr3verse
Loading required package: mlr3tuning
Error: package or namespace load failed for ‘mlr3tuning’ in namespaceExport(ns, exports):
 undefined exports: trm
Failed with error:  ‘package ‘mlr3tuning’ could not be loaded’

> sessionInfo()

R version 4.0.2 (2020-06-22)
Platform: x86_64-w64-mingw32/x64 (64-bit)
Running under: Windows 10 x64 (build 19041)

Matrix products: default

locale:
[1] LC_COLLATE=English_United States.1252 
[2] LC_CTYPE=English_United States.1252   
[3] LC_MONETARY=English_United States.1252
[4] LC_NUMERIC=C                          
[5] LC_TIME=English_United States.1252    

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

other attached packages:
[1] mlr3pipelines_0.2.1 mlr3learners_0.2.0  mlr3filters_0.3.0  
[4] mlr3_0.5.0         

loaded via a namespace (and not attached):
 [1] lgr_0.3.4         paradox_0.4.0     mlr3misc_0.5.0    withr_2.2.0      
 [5] digest_0.6.25     crayon_1.3.4      R6_2.4.1          backports_1.1.8  
 [9] uuid_0.1-4        data.table_1.13.0 rstudioapi_0.11   bbotk_0.2        
[13] checkmate_2.0.0   tools_4.0.2       yaml_2.2.1        compiler_4.0.2  

Also:

mlr3verse::mlr3verse_info()
 Error in namespaceExport(ns, exports) : undefined exports: trm 

traceback()

10.
stop(gettextf("undefined exports: %s", undef), domain = NA) 
9.
namespaceExport(ns, exports) 
8.
loadNamespace(j <- i[[1L]], c(lib.loc, .libPaths()), versionCheck = vI[[j]]) 
7.
asNamespace(ns) 
6.
namespaceImportFrom(ns, loadNamespace(j <- i[[1L]], c(lib.loc, 
    .libPaths()), versionCheck = vI[[j]]), i[[2L]], from = package) 
5.
loadNamespace(name) 
4.
getNamespace(ns) 
3.
asNamespace(ns) 
2.
getExportedValue(pkg, name) 
1.
mlr3verse::mlr3verse_info 

Please advise. Thank you!

pat-s commented 4 years ago

I suspect some other package (like {mlr3}) is trying to load some new functions from {mlr3tuning} but fails because package versions do not align (trm is new sugar in v0.2.0 in {mlr3tuning}). Try updating all mlr3 related packages.

drag05 commented 4 years ago

@pat-s: I was hoping the version match is insured by mlr3verse itself.

The list of my mlr3 packages:

> mlr3Packages <- library()$results[idx, 'Package']

 [1] "mlr3"                         "mlr3data"                    
 [3] "mlr3db"                       "mlr3filters"                 
 [5] "mlr3keras"                    "mlr3learners"                
 [7] "mlr3learners.proba"           "mlr3learners.randomforest"   
 [9] "mlr3learners.randomforestsrc" "mlr3learners.rweka"          
[11] "mlr3measures"                 "mlr3misc"                    
[13] "mlr3pipelines"                "mlr3proba"                   
[15] "mlr3shiny"                    "mlr3tuning"                  
[17] "mlr3verse"                    "mlr3viz"             

install.packages(mlr3Packages) 

#gives a 

Warning in install.packages :

packages ‘mlr3keras’, ‘mlr3learners.proba’, ‘mlr3learners.randomforest’,
‘mlr3learners.randomforestsrc’, ‘mlr3learners.rweka’ are not available (for R version 4.0.2):

# the rest are installed

package ‘mlr3’ successfully unpacked and MD5 sums checked
package ‘mlr3data’ successfully unpacked and MD5 sums checked
package ‘mlr3db’ successfully unpacked and MD5 sums checked
package ‘mlr3filters’ successfully unpacked and MD5 sums checked
package ‘mlr3learners’ successfully unpacked and MD5 sums checked
package ‘mlr3measures’ successfully unpacked and MD5 sums checked
package ‘mlr3misc’ successfully unpacked and MD5 sums checked
package ‘mlr3pipelines’ successfully unpacked and MD5 sums checked
package ‘mlr3proba’ successfully unpacked and MD5 sums checked
package ‘mlr3shiny’ successfully unpacked and MD5 sums checked
package ‘mlr3tuning’ successfully unpacked and MD5 sums checked
package ‘mlr3verse’ successfully unpacked and MD5 sums checked
package ‘mlr3viz’ successfully unpacked and MD5 sums checked

Restarting R session...

> require(mlr3verse)
Loading required package: mlr3verse
Loading required package: mlr3
Loading required package: mlr3filters
Loading required package: mlr3learners
Loading required package: mlr3pipelines
Loading required package: mlr3tuning
Error: package or namespace load failed for ‘mlr3tuning’ in namespaceExport(ns, exports):
 undefined exports: trm
Failed with error:  ‘package ‘mlr3tuning’ could not be loaded’

Could it be that any of the packages in installation warning are the cause? I would load each package individually but mlr3tuning cannot be loaded yet:

> require(mlr3tuning)

Loading required package: mlr3tuning
Error: package or namespace load failed for ‘mlr3tuning’ in namespaceExport(ns, exports):
 undefined exports: trm

Please advise. Thank you!

drag05 commented 4 years ago

@pat-s

Re-installing bbotk seems to have done the trick:

Restarting R session...

> require(mlr3verse)
Loading required package: mlr3verse
Loading required package: mlr3
Loading required package: mlr3filters
Loading required package: mlr3learners
Loading required package: mlr3pipelines
Loading required package: mlr3tuning
Loading required package: mlr3viz
Loading required package: paradox

Thank you!

pat-s commented 4 years ago

Thanks for the reply. Makes sense, {bbotk} is a utility package for {mlr3tuning} and should also be updated when {mlr3tuning} is updated.

Generally it is a good approach to always update all packages once a week or so.

drag05 commented 4 years ago

@pat-s

It wasn't an update per se, just re-installation; before and after versions of bbotk were similar.

Thank you for your time!