简体   繁体   English

在Anaconda Windows安装下运行网状问题

[英]Problems running reticulate under Anaconda Windows install

I'm having trouble doing even the most basic things with the reticulate library in R Studio. 我在使用R Studio中的网状库进行最基本的操作时遇到了麻烦。 My code looks as follows: 我的代码如下所示:

library(reticulate)
use_python("C:\\Users\\User2017\\AppData\\Local\\Programs\\Python\\Python36\\python.exe")
 req <- import("requests")

With the last line I get an error 最后一行我得到一个错误

 parse error: trailing garbage 2017\\\\Documents\\\\.condarc" } Using Anaconda Cloud api site h (right here) ------^ 

How can I get this working? 我该如何工作? Using requests is just for example, every other package fails. 仅以使用请求为例,其他所有包都会失败。 The python I'm pointing the reticulate package to is the system wide python that has various packages already installed. 我将网状软件包指向的python是已经安装了各种软件包的系统范围的python。

My specs from running sessionInfo() : 我从运行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

The same problem on my side: 在我这边,同样的问题:

pandas <- import("pandas") 
Error: parse error: trailing garbage
      Documents\\.condarc" } Using Anaconda Cloud api site h
                 (right here) ------^

I have followed the suggestions of smci: after removing Anaconda from my computer and re-linking to another python installation, the problem has disappeared: 我遵循了smci的建议:从计算机上删除Anaconda并重新链接到另一个python安装后,问题消失了:

use_python("~/Python36/python")
os <- import("os")

Hope that helps! 希望有帮助!

Addition: Python 2.7.11, Anaconda2 4.0.0 64-bit 附加:Python 2.7.11,Anaconda2 4.0.0 64位

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM