本文介绍了如何在不编辑配置文件或传递硬路径的情况下从命令行启动jupyter Notebook以在我的当前目录中运行?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

Juypter笔记本当前有一个限制:在当前目录中启动终端

Juypter notebook currently has a limitation: Starting terminal in current directory

我如何通过命令行(没有Anaconda或其他GUI)没有以下不可接受的黑客手段来做到这一点? (尤其是笔记本目录在两次调用之间或在用户之间可能会改变的地方?)

How do I do this from command-line (no Anaconda or other GUI), without the following unacceptable hacky approaches? (and in particular where the notebook directory might well change between invocations, or between users?)

  1. 手动将硬路径编辑到jupyter笔记本配置文件中, c.NotebookApp.notebook_dir参数

将硬路径嵌入到笔记本代码中.必须是绝对路径.(yukky).也取决于用户.无法分发笔记本电脑,该笔记本电脑使用相对于其安装目录的路径正确处理文件.或跨机器.

Embed hard paths into your notebook code. Must be absolute paths.(yukky). Also user-dependent. Can't distribute notebooks which handle files properly with paths relative to their install dir. Or across machines.

推荐答案

到目前为止(在Unix上)找到的最佳解决方案:

Best solution found so far (on Unix):

jupyter notebook --notebook-dir  `pwd` &

因为

jupyter notebook --notebook-dir  . &

(相对路径)不适用于笔记本内部的命令.

(relative-paths) won't work for commands from inside the notebook.

这篇关于如何在不编辑配置文件或传递硬路径的情况下从命令行启动jupyter Notebook以在我的当前目录中运行?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

10-18 16:00