我在使用 R Studio 中的网状库做最基本的事情时都遇到了麻烦。我的代码如下所示:
library(reticulate)
use_python("C:\\Users\\User2017\\AppData\\Local\\Programs\\Python\\Python36\\python.exe")
req <- import("requests")
最后一行我得到一个错误
parse error: trailing garbage 2017\\Documents\\.condarc" } Using Anaconda Cloud api site h (right here) ------^
我怎样才能得到这个工作?例如,使用 requests ,所有其他包都会失败。我将网状包指向的python 是系统范围的python,它已经安装了各种包。
我运行 sessionInfo() 的规格:
R version 3.5.3 (2019-03-11)
Platform: x86_64-w64-mingw32/x64 (64-bit)
Running under: Windows >= 8 x64 (build 9200)
Matrix products: default
locale:
[1] LC_COLLATE=English_Australia.1252 LC_CTYPE=English_Australia.1252 LC_MONETARY=English_Australia.1252
[4] LC_NUMERIC=C LC_TIME=English_Australia.1252
attached base packages:
[1] stats graphics grDevices utils datasets methods base
other attached packages:
[1] reticulate_1.11.1
loaded via a namespace (and not attached):
[1] compiler_3.5.3 Matrix_1.2-15 tools_3.5.3 yaml_2.2.0 Rcpp_1.0.1 grid_3.5.3 jsonlite_1.6
[8] lattice_0.20-38