jupyter-notebook - "module not found"在 jupyter 实验室中,但在 "jupyter notebook"中工作正常

标签 jupyter-notebook jupyter-lab

我使用的是conda python环境。我按照以下步骤启动 Jupyter 实验室:

$conda activate <env_name>
$jupyter lab --no-browser --port=8080 &

现在,当我尝试从 jupyter lab notebook 导入 feather(导入 feather)时,它失败并显示 Module Not Found 消息。

在 jupyter lab notebook 中,如果我执行以下命令,它会显示存在羽毛:

! conda list | grep feather

现在,如果我在同一个虚拟机中关闭 Jupyter Lab 并改为启动 Jupyter Notebook,feather 就会从笔记本中成功导入。

$conda activate <env_name>
$jupyter-notebook --no-browser --port=8080 &

我看到 this讨论,但看不到解决方案。

最佳答案

或者,从您的 Jupyter notebook 中或在命令行中检查您的路径。我发现将模块路径附加到 sys.path 解决了这个确切的问题。

我的案例中缺少所有 ~/anaconda3/envs/[env]/lib/python3.7* 路径。

关于jupyter-notebook - "module not found"在 jupyter 实验室中,但在 "jupyter notebook"中工作正常,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/54979928/

相关文章:

python - 从命令行在正在运行的服务器中打开 Jupyter notebook

r - 必须安装 jupyter-client,但 “jupyter kernelspec --version” 以代码 127 退出

python-3.x - 从 jupyter 实验室复制 matlibplot 绘图图像

python - 在 Jupyter 中导入 PyCaret 时找不到模块

python-3.x - 使用魔术命令 %% timeit -n1 -r1 导致 jupyter 不保留局部变量的值

python - 朱皮特 : Line magic function not found

python - pandas 列值到行值

jupyter - 如何共享 Jupyter 笔记本

python - 有没有办法在 conda 环境中指定 jupyter 实验室扩展?

linux - 服务器上的其他用户无法打开 JupyterHub