首页 > 解决方案 > 为什么 RStudio 不能显示 python 脚本的参数?

问题描述

当我在 R 中打开一个 python 脚本时,它会自动完成函数或库。例如,如果我开始输入 pd.read_excel(),R 将提供完成它。但是只要我的光标在函数内,点击 tab 或 ctrl+space 将不会为我提供任何参数。我希望编码与 R 完全相同:RStudio 提供自动完成功能,我点击选项卡,然后我点击选项卡检查参数(或默认弹出)。我错过了什么?

此外,当我的光标位于函数内部时,当我点击制表符或 ctrl+空格时,它会插入一个“=”,神秘地......

R version 4.1.0 (2021-05-18)
Platform: x86_64-w64-mingw32/x64 (64-bit)
Running under: Windows 10 x64 (build 18363)

Matrix products: default


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

other attached packages:
 [1] forcats_0.5.1   stringr_1.4.0   dplyr_1.0.7     purrr_0.3.4    
 [5] readr_1.4.0     tidyr_1.1.3     tibble_3.1.2    ggplot2_3.3.5  
 [9] tidyverse_1.3.1 reticulate_1.22

loaded via a namespace (and not attached):
 [1] tidyselect_1.1.1  xfun_0.24         haven_2.4.1       lattice_0.20-44  
 [5] colorspace_2.0-2  vctrs_0.3.8       generics_0.1.0    htmltools_0.5.1.1
 [9] yaml_2.2.1        utf8_1.2.1        rlang_0.4.11      pillar_1.6.1     
[13] withr_2.4.2       glue_1.4.2        DBI_1.1.1         rappdirs_0.3.3   
[17] dbplyr_2.1.1      modelr_0.1.8      readxl_1.3.1      lifecycle_1.0.0  
[21] munsell_0.5.0     gtable_0.3.0      cellranger_1.1.0  rvest_1.0.0      
[25] evaluate_0.14     knitr_1.33        fansi_0.5.0       broom_0.7.8      
[29] Rcpp_1.0.7        backports_1.2.1   scales_1.1.1      jsonlite_1.7.2   
[33] fs_1.5.0          hms_1.1.0         png_0.1-7         digest_0.6.27    
[37] stringi_1.6.2     grid_4.1.0        rprojroot_2.0.2   cli_3.0.1        
[41] here_1.0.1        tools_4.1.0       magrittr_2.0.1    crayon_1.4.1     
[45] pkgconfig_2.0.3   ellipsis_0.3.2    Matrix_1.3-3      xml2_1.3.2       
[49] reprex_2.0.0      lubridate_1.7.10  rstudioapi_0.13   assertthat_0.2.1 
[53] rmarkdown_2.11    httr_1.4.2        R6_2.5.0          compiler_4.1.0  

标签: pythonriderstudioreticulate

解决方案


推荐阅读