如何解决无法在 R 中使用 reticulate
我在 RStudio (1.4) 上遇到了一个问题,我在帮助面板中看不到 Python 文档。我正在使用 reticulate
v. 1.20 并且我的 Python 解释器工作正常。但是,如果我使用 F1 键盘快捷键或运行例如 ?np.random.rand
,我会收到以下错误:
>>> ?np.random.rand
Error in html$page(pydoc$describe(resolved),html$document(resolved,name)) :
attempt to apply non-function
Error in html$page(pydoc$describe(resolved),name)) :
attempt to apply non-function
帮助面板显示:/python/np.random.rand.html not found
在其他任何地方都没有遇到过这个问题。
解决方法
这似乎在 reticulate
的开发版中修复了,可以如下安装:
devtools::install_github("rstudio/reticulate")
该功能是否存在于 reticulate
中?有一个请求帮助的内置函数:py_help
- https://rdrr.io/github/rstudio/reticulate/man/py_help.html
例如以下为我启动了一个帮助文件
library(reticulate)
os <- import("os")
py_help(os$listdir)
版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。