chainsawriot / rectr

💒 Reproducible Extraction of Cross-lingual Topics using R
GNU Lesser General Public License v2.1
20 stars 5 forks source link

Problems in setup #3

Closed lucacarbonelc closed 4 years ago

lucacarbonelc commented 4 years ago

Hello! Thank you for creating this package, it looks great!

I'm trying to get the setup ready to run some analyses, but I am encountering a problem with the mbert_env_setup() function. When running the function, I get this error:

sh: conda: command not found
Warning message:
In system2("conda", args = c("env", "create", paste0("-f=", system.file("python",  :
  error in running command

Premise: when running it the first time, I did not have Python installed on my computer. After having installed it, the error still pops up. Also, I am a new at Python, but I think that if this is really needed, having a small description about how to install it or how to make it work without any other thing than just following the script would be of great help!

I am not sure whether this is an actual issue of the function, such that this comment could be beneficial to improve it or make it more clear, or if it is my inexperience with Python at making it difficult. In any case, could you help me out with this?

These are my session info:

R version 3.6.3 (2020-02-29)
Platform: x86_64-apple-darwin15.6.0 (64-bit)
Running under: macOS Catalina 10.15.7

Matrix products: default
BLAS:   /System/Library/Frameworks/Accelerate.framework/Versions/A/Frameworks/vecLib.framework/Versions/A/libBLAS.dylib
LAPACK: /Library/Frameworks/R.framework/Versions/3.6/Resources/lib/libRlapack.dylib

locale:
[1] en_US.UTF-8/en_US.UTF-8/en_US.UTF-8/C/en_US.UTF-8/en_US.UTF-8

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

loaded via a namespace (and not attached):
 [1] Rcpp_1.0.5       pillar_1.4.6     compiler_3.6.3   tools_3.6.3      digest_0.6.26    jsonlite_1.7.1  
 [7] evaluate_0.14    memoise_1.1.0    lifecycle_0.2.0  tibble_3.0.4     lattice_0.20-38  pkgconfig_2.0.3 
[13] rlang_0.4.8      Matrix_1.2-18    rstudioapi_0.11  crul_0.9.0       curl_4.3         yaml_2.2.1      
[19] xfun_0.18        httr_1.4.2.9000  dplyr_1.0.2      knitr_1.30       generics_0.0.2   fs_1.5.0        
[25] vctrs_0.3.4      cld3_1.3         grid_3.6.3       tidyselect_1.1.0 reticulate_1.17  glue_1.4.2      
[31] httpcode_0.3.0   R6_2.4.1         rmarkdown_2.4    pacman_0.5.1     rectr_0.1.3      purrr_0.3.4     
[37] magrittr_1.5     osfr_0.2.8.9000  ellipsis_0.3.1   htmltools_0.5.0  stringi_1.5.3    crayon_1.3.4
lucacarbonelc commented 4 years ago

Solved with this:

# Create conda environment
reticulate::conda_create(
  envname = "rectr_condaenv",
  packages = c("torchvision", "transformers", "python"))

# Use the environment
conda_list()[[1]][2] %>% 
  use_condaenv(required = TRUE)