在Google Colab上的R笔记本中安装python库

时间:2020-08-07 21:20:22

标签: python r google-colaboratory

我正在尝试在Google Colab的R笔记本中安装python库,为此我使用了“网状”包:

library(reticulate)
py_install("pandas")

但是我得到这个错误:

Error: could not find a Python environment for /usr/bin/python3

是否可以解决此错误?

1 个答案:

答案 0 :(得分:3)

您不能直接在Google Colab中执行此操作,但可以与本地运行时共享它。 Google Colab不支持安装新版本的python或R。如果您在R笔记本中,则只能使用R,因为Colab云计算机上没有安装python。但是,如果您连接到本地运行时,则可以使用这些功能。

有关更多信息,您可以检查以下链接:

How to use R and Python with Google Colaboratory Notebook?

How to use R with Google Colaboratory?