在Google Colab上的R笔记本中安装python库 [英] Installing a python library in an R notebook on Google Colab

查看:89
本文介绍了在Google Colab上的R笔记本中安装python库的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

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

I'm trying to install a python library in an R notebook on Google Colab, I use for this the 'reticulate' package:

library(reticulate)
py_install("pandas")

但是我得到这个错误:

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

是否可以解决此错误?

推荐答案

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

You can't do that directly in Google Colab but you can share it with local runtime. Google Colab doesn't support installing a new version of python or R. If you are in R notebook you can only use R because there is no python installed on the Colab cloud computer. But if you connect with your local runtime you can use those functions.

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

For more you can check these links:

如何在Google Colaboratory Notebook中使用R和Python吗?

如何在Google合作实验室中使用R?

这篇关于在Google Colab上的R笔记本中安装python库的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆