Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Loading golgotcha crashes due to python dependencies #11

Open
laresbernardo opened this issue Aug 9, 2021 · 4 comments
Open

Loading golgotcha crashes due to python dependencies #11

laresbernardo opened this issue Aug 9, 2021 · 4 comments

Comments

@laresbernardo
Copy link

Hi! I've just installed the package successfully and then when loading golgotcha it returned an error:

> devtools::install_github("bnosac/golgotha", INSTALL_opts = "--no-multiarch")
Using github PAT from envvar GITHUB_PAT
Downloading GitHub repo bnosac/golgotha@HEAD
✓  checking for file ‘/private/var/folders/3w/x0bjsdv52v3b3kjbw87y3wfw0000gn/T/RtmpGIic1l/remotes866533484609/bnosac-golgotha-6f9f2bf/DESCRIPTION’ ...
─  preparing ‘golgotha’:
✓  checking DESCRIPTION meta-information ...
─  checking for LF line-endings in source and make files and shell scripts
─  checking for empty or unneeded directories
─  building ‘golgotha_0.2.0.tar.gz’
   
Installing package into ‘/Users/bernardolares/Library/R/4.0/library’
(as ‘lib’ is unspecified)
* installing *source* package ‘golgotha’ ...
** using staged installation
** R
** inst
** byte-compile and prepare package for lazy loading
** help
*** installing help indices
** building package indices
** installing vignettes
** 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 (golgotha)
> library(golgotha)
Loading required package: reticulate
Configuring package 'golgotha': please wait ...
Collecting torch
  Downloading torch-1.9.0-cp39-none-macosx_10_9_x86_64.whl (127.9 MB)
Collecting transformers==2.4.1
  Downloading transformers-2.4.1-py3-none-any.whl (475 kB)
Collecting boto3
  Downloading boto3-1.18.16-py3-none-any.whl (131 kB)
Collecting tqdm>=4.27
  Downloading tqdm-4.62.0-py2.py3-none-any.whl (76 kB)
Requirement already satisfied: numpy in ./Library/r-miniconda/envs/r-reticulate/lib/python3.9/site-packages (from transformers==2.4.1) (1.21.1)
Collecting sentencepiece
  Downloading sentencepiece-0.1.96-cp39-cp39-macosx_10_6_x86_64.whl (1.1 MB)
Collecting tokenizers==0.0.11
  Downloading tokenizers-0.0.11.tar.gz (30 kB)
  Installing build dependencies: started
  Installing build dependencies: finished with status 'done'
  Getting requirements to build wheel: started
  Getting requirements to build wheel: finished with status 'done'
    Preparing wheel metadata: started
    Preparing wheel metadata: finished with status 'done'
Collecting filelock
  Downloading filelock-3.0.12-py3-none-any.whl (7.6 kB)
Collecting sacremoses
  Downloading sacremoses-0.0.45-py3-none-any.whl (895 kB)
Collecting requests
  Downloading requests-2.26.0-py2.py3-none-any.whl (62 kB)
Collecting regex!=2019.12.17
  Downloading regex-2021.8.3-cp39-cp39-macosx_10_9_x86_64.whl (285 kB)
Requirement already satisfied: typing-extensions in ./Library/r-miniconda/envs/r-reticulate/lib/python3.9/site-packages (from torch) (3.10.0.0)
Collecting botocore<1.22.0,>=1.21.16
  Downloading botocore-1.21.16-py3-none-any.whl (7.8 MB)
Collecting jmespath<1.0.0,>=0.7.1
  Downloading jmespath-0.10.0-py2.py3-none-any.whl (24 kB)
Collecting s3transfer<0.6.0,>=0.5.0
  Downloading s3transfer-0.5.0-py3-none-any.whl (79 kB)
Requirement already satisfied: python-dateutil<3.0.0,>=2.1 in ./Library/r-miniconda/envs/r-reticulate/lib/python3.9/site-packages (from botocore<1.22.0,>=1.21.16->boto3->transformers==2.4.1) (2.8.2)
Collecting urllib3<1.27,>=1.25.4
  Downloading urllib3-1.26.6-py2.py3-none-any.whl (138 kB)
Requirement already satisfied: six>=1.5 in ./Library/r-miniconda/envs/r-reticulate/lib/python3.9/site-packages (from python-dateutil<3.0.0,>=2.1->botocore<1.22.0,>=1.21.16->boto3->transformers==2.4.1) (1.16.0)
Requirement already satisfied: certifi>=2017.4.17 in ./Library/r-miniconda/envs/r-reticulate/lib/python3.9/site-packages (from requests->transformers==2.4.1) (2021.5.30)
Collecting charset-normalizer~=2.0.0
  Downloading charset_normalizer-2.0.4-py3-none-any.whl (36 kB)
Collecting idna<4,>=2.5
  Downloading idna-3.2-py3-none-any.whl (59 kB)
Collecting click
  Downloading click-8.0.1-py3-none-any.whl (97 kB)
Requirement already satisfied: joblib in ./Library/r-miniconda/envs/r-reticulate/lib/python3.9/site-packages (from sacremoses->transformers==2.4.1) (1.0.1)
Building wheels for collected packages: tokenizers
  Building wheel for tokenizers (PEP 517): started
  Building wheel for tokenizers (PEP 517): finished with status 'error'
  ERROR: Command errored out with exit status 1:
   command: /Users/bernardolares/Library/r-miniconda/envs/r-reticulate/bin/python /Users/bernardolares/Library/r-miniconda/envs/r-reticulate/lib/python3.9/site-packages/pip/_vendor/pep517/in_process/_in_process.py build_wheel /var/folders/3w/x0bjsdv52v3b3kjbw87y3wfw0000gn/T/tmp4_14r7ur
       cwd: /private/var/folders/3w/x0bjsdv52v3b3kjbw87y3wfw0000gn/T/pip-install-hydjbfqr/tokenizers_800ac7fe01f240cf9fe99c8faeb338df
  Complete output (20 lines):
  running bdist_wheel
  running build
  running build_py
  creating build
  creating build/lib
  creating build/lib/tokenizers
  copying tokenizers/__init__.py -> build/lib/tokenizers
  running build_ext
  running build_rust
  error: can't find Rust compiler
  
  If you are using an outdated pip version, it is possible a prebuilt wheel is available for this package but pip is not able to install from it. Installing from the wheel would avoid the need for a Rust compiler.
  
  To update pip, run:
  
      pip install --upgrade pip
  
  and then retry package installation.
  
  If you did intend to build this package from source, try installing a Rust compiler from your system package manager and ensure it is on the PATH during installation. Alternatively, rustup (available at https://rustup.rs) is the recommended way to download and update the Rust compiler toolchain.
  ----------------------------------------
  ERROR: Failed building wheel for tokenizers
Failed to build tokenizers
ERROR: Could not build wheels for tokenizers which use PEP 517 and cannot be installed directly
Error: package or namespace load failed for ‘golgotha’:
 .onLoad failed in loadNamespace() for 'golgotha', details:
  call: NULL
  error: Error installing package(s): 'torch', 'transformers==2.4.1'

My sessionInfo():

R version 4.0.3 (2020-10-10)
Platform: x86_64-apple-darwin17.0 (64-bit)
Running under: macOS  11.4

Matrix products: default
LAPACK: /Library/Frameworks/R.framework/Versions/4.0/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     

other attached packages:
[1] reticulate_1.20 Robyn_3.0.0     ggplot2_3.3.5   dplyr_1.0.7     lares_5.0.2    

loaded via a namespace (and not attached):
 [1] bitops_1.0-7       fs_1.5.0           usethis_2.0.1      lubridate_1.7.10   devtools_2.4.0    
 [6] doParallel_1.0.16  httr_1.4.2         rprojroot_2.0.2    tools_4.0.3        doRNG_1.8.2       
[11] utf8_1.2.2         R6_2.5.0           rpart_4.1-15       lazyeval_0.2.2     DBI_1.1.0         
[16] colorspace_2.0-2   withr_2.4.2        tidyselect_1.1.1   prettyunits_1.1.1  processx_3.5.2    
[21] curl_4.3.2         compiler_4.0.3     glmnet_4.1-2       cli_3.0.1          rvest_1.0.0       
[26] xml2_1.3.2         desc_1.3.0         labeling_0.4.2     scales_1.1.1       callr_3.7.0       
[31] rappdirs_0.3.3     stringr_1.4.0      digest_0.6.27      pkgconfig_2.0.3    parallelly_1.27.0 
[36] sessioninfo_1.1.1  fastmap_1.0.1      rlang_0.4.11       rstudioapi_0.13    rPref_1.3         
[41] shape_1.4.6        prophet_1.0        farver_2.1.0       generics_0.1.0     jsonlite_1.7.2    
[46] zip_2.2.0          RCurl_1.98-1.3     magrittr_2.0.1     patchwork_1.1.1    Matrix_1.2-18     
[51] Rcpp_1.0.7         munsell_0.5.0      fansi_0.5.0        lifecycle_1.0.0    stringi_1.7.3     
[56] pROC_1.17.0.1      yaml_2.2.1         pkgbuild_1.2.0     plyr_1.8.6         grid_4.0.3        
[61] parallel_4.0.3     listenv_0.8.0      crayon_1.4.1       lattice_0.20-41    splines_4.0.3     
[66] ps_1.6.0           pillar_1.6.2       igraph_1.2.6       rngtools_1.5       codetools_0.2-18  
[71] pkgload_1.2.1      glue_1.4.2         doFuture_0.12.0    RcppParallel_5.1.4 rpart.plot_3.0.9  
[76] data.table_1.14.0  remotes_2.3.0      png_0.1-7          vctrs_0.3.8        nloptr_1.2.2.2    
[81] foreach_1.5.1      testthat_3.0.4     gtable_0.3.0       purrr_0.3.4        tidyr_1.1.3       
[86] future_1.21.0      assertthat_0.2.1   cachem_1.0.4       openxlsx_4.2.4     h2o_3.32.1.3      
[91] survival_3.2-7     minpack.lm_1.2-1   tibble_3.1.3       iterators_1.0.13   memoise_2.0.0     
[96] corrplot_0.90      globals_0.14.0     ellipsis_0.3.2  
@jwijffels
Copy link
Contributor

The transformers python module needs the tokenizers python package which requires to install Rust nowadays

@laresbernardo
Copy link
Author

What should be the steps to follow? Can we include this step to Installation section? I tried running the installation on Terminal, restarted RStudio, and still getting the error. Any recommendation? Thanks @jwijffels

@jwijffels
Copy link
Contributor

Install rust

@SatoshiReport
Copy link

I tried that and same error. I used: curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants