[英]Problems running reticulate under Anaconda Windows install
我在使用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) ------^
我該如何工作? 僅以使用請求為例,其他所有包都會失敗。 我將網狀軟件包指向的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
在我這邊,同樣的問題:
pandas <- import("pandas")
Error: parse error: trailing garbage
Documents\\.condarc" } Using Anaconda Cloud api site h
(right here) ------^
我遵循了smci的建議:從計算機上刪除Anaconda並重新鏈接到另一個python安裝后,問題消失了:
use_python("~/Python36/python")
os <- import("os")
希望有幫助!
附加:Python 2.7.11,Anaconda2 4.0.0 64位
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.