'repl_python()'无法将python模块导入R

时间:2019-01-01 23:45:57

标签: python r reticulate

我正在尝试在我的R环境中使用repl_python()交互使用python。不幸的是我没有取得太大进展。有任何想法吗?我签出了Importing python module in R,但我的R环境正在连接到正确的python路径(我认为)。

library(reticulate)
repl_python()
  Python 3.7.1 (/anaconda3/envs/r-reticulate/bin/python)
  Reticulate 1.10 REPL -- A Python interpreter in R.
>>> import pandas as pd
  ModuleNotFoundError: No module named 'pandas'

这是我的R会话信息:

sessionInfo()
R version 3.5.1 (2018-07-02)
Platform: x86_64-apple-darwin15.6.0 (64-bit)
Running under: macOS High Sierra 10.13.6

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.5/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  
[7] base     

other attached packages:
[1] reticulate_1.10

loaded via a namespace (and not attached):
 [1] Rcpp_1.0.0        urca_1.3-0        pillar_1.3.0     
 [4] compiler_3.5.1    plyr_1.8.4        bindr_0.1.1      
 [7] tseries_0.10-46   tools_3.5.1       xts_0.11-2       
[10] jsonlite_1.6      nlme_3.1-137      tibble_1.4.2     
[13] gtable_0.2.0      lattice_0.20-35   pkgconfig_2.0.2  
[16] rlang_0.3.0.1     Matrix_1.2-14     rstudioapi_0.8   
[19] curl_3.2          parallel_3.5.1    bindrcpp_0.2.2   
[22] knitr_1.20        dplyr_0.7.8       uroot_2.0-9      
[25] lmtest_0.9-36     grid_3.5.1        nnet_7.3-12      
[28] forecast_8.4      tidyselect_0.2.5  glue_1.3.0       
[31] R6_2.3.0          ggplot2_3.1.0     purrr_0.2.5      
[34] TTR_0.23-4        magrittr_1.5      scales_1.0.0     
[37] assertthat_0.2.0  quantmod_0.4-13   timeDate_3043.102
[40] colorspace_1.3-2  fracdiff_1.4-2    quadprog_1.5-5   
[43] lazyeval_0.2.1    munsell_0.5.0     crayon_1.3.4     
[46] zoo_1.8-4  

0 个答案:

没有答案