首页 > 解决方案 > 在 Binder 中安装 Pandas for Jupyter notebook

问题描述

我在 GitHub 上有一个 Jupyter 笔记本,想在 Binder 中运行它,以便其他人可以使用它。

但是它抱怨没有安装熊猫。错误是:

ModuleNotFoundError: No module named 'pandas'

我怎样才能让 Binder 为这个实例安装熊猫?

标签: pandasjupyter-notebook

解决方案


您必须在 repo 的基础上编辑/创建requirements.txt。我尝试在单元格中使用 pip install 方法,但这对 Binder 不起作用,因为它会阻止您会话中的实时安装。

您可以列出您需要的模块并在需要时指定版本。

这个 GitHub 中有一个例子:

内容是:

numpy==1.16.*
matplotlib==3.*
seaborn==0.8.1
pandas

推荐阅读