pandas - 在 Binder 中安装 Pandas for Jupyter notebook
问题描述
我在 GitHub 上有一个 Jupyter 笔记本,想在 Binder 中运行它,以便其他人可以使用它。
但是它抱怨没有安装熊猫。错误是:
ModuleNotFoundError: No module named 'pandas'
我怎样才能让 Binder 为这个实例安装熊猫?
解决方案
您必须在 repo 的基础上编辑/创建requirements.txt
。我尝试在单元格中使用 pip install 方法,但这对 Binder 不起作用,因为它会阻止您会话中的实时安装。
您可以列出您需要的模块并在需要时指定版本。
这个 GitHub 中有一个例子:
内容是:
numpy==1.16.*
matplotlib==3.*
seaborn==0.8.1
pandas
推荐阅读
- makefile - make/gmake:给定一个以多个../开头的变量,创建一个少一个../的变量
- python-3.x - 在 Python 中使用 df.shift 遍历列
- c# - 如何检测是否安装了 Powershell Core 以及 C# 中的哪个版本?
- amazon-web-services - NoSuchKey:指定的密钥不存在 AWS S3 Codebuild
- python - 为什么程序没有从字符串中找到任何电子邮件?
- c# - 如何禁用模型验证以允许流畅的验证检查
- php - 将列的格式更改为日期时间 MySql
- logging - ELK Stack 的 Grok 条件解析
- python - discord.py - 即使没有错误消息,机器人也没有响应
- javascript - 在 blazor 项目中使用 javascript 加载特定页面时更改元素的颜色