476/5000 当使用 python 代码运行 R 代码时,rstudio 会生成错误。起初,代码运行得很好,但在第二次安装时,它开始产生错误。如果您想玩#https,这里是代码的链接://www.r-bloggers.com/r-and-python-using-reticulate-to-get-the-best-of-both-worlds/ 。我的笔记本电脑是 HP 4 GB 内存和 500 MB 硬盘。 我将非常感谢谁能解释失败以及如何解决它。
我已经重新安装了 anaconda 最新版本两次。
library(reticulate) use_python("/usr/local/bin/python")
use_virtualenv("r-reticulate")
os <- import("os") Error: lexical error: invalid char in json text. WARNING: The conda.compat modul (right here) ------^ os$listdir(".") Error: object 'os' not found py_config() Error: lexical error: invalid char in json text. WARNING: The conda.compat modul (right here) ------^
最佳答案
实际上,它来自几天前报告的弃用警告 ( fix compat import showing warning #8507 )。 但事实是,“conda.compat”中的此警告会生成一些错误,例如在通过“reticulate”函数在 R 中使用 conda 环境的情况下。最近报告了此问题 Conda warnings taken as errors #477 .
解决方案是简单地安装 github 版本的“reticulate”,以避免这些错误并忽略 conda 警告,这些警告不一定会妨碍这些功能。你可以这样做:
remotes::install_github("rstudio/reticulate")
并且不要忘记在您的操作系统中安装最新的 Rtools!
关于anaconda - rstudio中网状结构出现故障,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/55545861/