简体   繁体   中英

Fail to install tdplyr package. error: argument is not an environment

thanks for checking out my very first post. please bear with my formatting.

Issue summary: I have been using tdplyr to access teradata database with no issue until I tested another package called dplyr.teradata for potential performance enhancement. However I can no longer connect to the database due to the following error messages:

Error: package or namespace load failed for 'tdplyr':.onLoad failed in loadNamespace() for 'tdplyr', details: call: parent.env(from) error: argument is not an environment

so I deleted the dplyr.teradata package, thought that would allow my original tdplyr to work, but I still get the same error message above. then I deleted the tdplyr package without backup, trying to reinstall using the original script below:

install.packages('tdplyr',repos=c('https://teradata-download.s3.amazonaws.com','https://cloud.r- 
project.org'))

but fail to install because of the same error again. Hope someone could advise on fix.

My sessioninfo is below:

sessionInfo()
R version 4.0.3 (2020-10-10)
Platform: x86_64-w64-mingw32/x64 (64-bit)
Running under: Windows 10 x64 (build 16299)

Matrix products: default

locale:
[1] LC_COLLATE=English_United States.1252  LC_CTYPE=English_United States.1252   
[3] LC_MONETARY=English_United States.1252 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] rlang_0.4.10         teradatasql_17.0.0.8 odbc_1.3.0           dplyr_1.0.2         
 [5] dbplyr_2.0.0         digest_0.6.27        DBI_1.1.0            hms_0.5.3           
 [9] bit64_4.0.5          bit_4.0.4           

loaded via a namespace (and not attached):
 [1] Rcpp_1.0.5       rstudioapi_0.13  magrittr_1.5     tidyselect_1.1.0 R6_2.4.1        
 [6] blob_1.2.1       tools_4.0.3      xfun_0.20        tinytex_0.28     ellipsis_0.3.1  
[11] assertthat_0.2.1 tibble_3.0.4     lifecycle_0.2.0  crayon_1.3.4     zip_2.1.1       
[16] purrr_0.3.4      vctrs_0.3.6      glue_1.4.2       openxlsx_4.2.3   stringi_1.5.3   
[21] compiler_4.0.3   pillar_1.4.6     generics_0.0.2   pkgconfig_2.0.3 

found the answer myself. Pasting the answer below.

The Teradata R package is incompatible with dbplyr v2.0.0 and its later versions, which introduced some breaking changes. To use tdplyr, the version of dbplyr package must be v1.4.4. tdplyr should be installed using the following commands from your Terminal (for Linux and Mac) or Command Prompt (for Windows), till a new version that is compatible with dbplyr v2.0.0 and its later versions is released:

Install dbplyr v1.4.4 first. There are various ways to install a specific version of a R package. Teradata recommends using the following command: Rscript -e "remotes::install_version('dbplyr',version='1.4.4',repos='https://cloud.r-project.org')" Note: To run this above command, the R package remotes should be present on the client machine.

Next to download and install tdplyr and dependencies automatically, if minimum required versions are not met, specify the Teradata R package repository and CRAN in the repos argument for install.packages. Rscript -e "install.packages('tdplyr',repos=c('https://teradata-download.s3.amazonaws.com','https://cloud.r-project.org'))"

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM