【问题标题】:Fail to install tdplyr package. error: argument is not an environment安装 tdplyr 包失败。错误:参数不是环境
【发布时间】:2021-04-15 05:08:48
【问题描述】:

感谢您查看我的第一篇文章。请忍受我的格式。

问题摘要:我一直使用 tdplyr 访问 teradata 数据库没有问题,直到我测试了另一个名为 dplyr.teradata 的软件包以提高性能。但是由于以下错误消息,我无法再连接到数据库:

错误:“tdplyr”的包或命名空间加载失败:.onLoad 失败 在 'tdplyr' 的 loadNamespace() 中,详细信息: 调用:parent.env(来自) 错误:参数不是环境

所以我删除了 dplyr.teradata 包,认为这可以让我原来的 tdplyr 工作,但我仍然收到上面相同的错误消息。然后我删除了没有备份的 tdplyr 包,尝试使用下面的原始脚本重新安装:

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

但由于同样的错误再次安装失败。希望有人可以就修复提出建议。

我的会话信息如下:

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 

【问题讨论】:

    标签: r teradata


    【解决方案1】:

    自己找到了答案。在下面粘贴答案。

    Teradata R 软件包与 dbplyr v2.0.0 及其更高版本不兼容,这引入了一些重大更改。要使用 tdplyr,dbplyr 软件包的版本必须是 v1.4.4。 tdplyr 应使用终端(适用于 Linux 和 Mac)或命令提示符(适用于 Windows)中的以下命令安装,直到发布与 dbplyr v2.0.0 及其更高版本兼容的新版本:

    首先安装 dbplyr v1.4.4。有多种方法可以安装特定版本的 R 包。 Teradata 建议使用以下命令: Rscript -e "remotes::install_version('dbplyr',version='1.4.4',repos='https://cloud.r-project.org')" 注意:要运行上述命令,R 包远程应该存在于客户端计算机上。

    接下来要自动下载和安装 tdplyr 和依赖项,如果不满足最低要求的版本,请在 install.packages 的 repos 参数中指定 Teradata R 包存储库和 CRAN。 rscript -e "install.packages('tdplyr',repos=c('https://teradata-download.s3.amazonaws.com','https://cloud.r-project.org'))"

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2012-01-08
      • 2014-06-01
      • 1970-01-01
      • 1970-01-01
      • 2019-07-06
      • 2014-04-14
      • 1970-01-01
      相关资源
      最近更新 更多