【发布时间】:2021-01-04 20:52:30
【问题描述】:
我正在尝试使用 mybinder.org 创建一个交互式笔记本。这些是我正在采取的步骤:
第一步:将notebook上传到githubgithub link to the simplistic notebook
第 2 步:使用 pip freeze > requirement.txt 创建一个 environment.txt 文件并将其上传到同一个 repo 中。 link to the requirement.txt file
第 3 步:在 mybinder.org 上渲染 notebook。 link to the rendered notebook
笔记本加载后,无法导入任何 numpy 或 pandas 库。我得到 ModuleNotFoundError: No module named 'numpy.这是错误的图像:
我做错了什么?任何提示都非常感谢;我已经研究了一段时间......如果它有帮助,我会使用 JupyterLab 准备我的笔记本。
【问题讨论】:
-
在菜单中点击 kernel > change kernel 并选择你想要使用的虚拟环境。
-
你能发布这个
import sys; print(sys.executable); print(sys.version); print(sys.version_info)的输出吗?这是您要使用的正确 python 版本吗? -
@JayPatel:当然。这是输出:
C:\Users\myusername\Anaconda3\python.exe 3.8.5 (default, Sep 3 2020, 21:29:08) [MSC v.1916 64 bit (AMD64)] sys.version_info(major=3, minor=8, micro=5, releaselevel='final', serial=0) -
@Walid:感谢您的评论。那并没有解决问题。 Kernel 下没有 virtual env 选项。
标签: python github conda jupyter-lab