command-line-interface - 如何从命令行启动 jupyter notebook 以在当前目录中运行,而无需编辑配置文件或传递硬路径?

标签 command-line-interface jupyter-notebook jupyter relative-path invocation

Juypter 笔记本目前有一个限制:Starting terminal in current directory

我如何从命令行执行此操作(没有 Anaconda 或其他 GUI),没有 以下 Not Acceptable hacky方法? (特别是笔记本目录可能在调用之间或用户之间发生变化的地方?)

  • 手动 edit the hard path into your jupyter notebook config file, in the c.NotebookApp.notebook_dir parameter
  • 将硬路径嵌入您的笔记本代码中。必须是绝对路径。
    (讨厌)。也依赖于用户。无法分发使用相对于其安装目录的路径正确处理文件的笔记本。或者跨机器。
  • 最佳答案

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

    jupyter notebook --notebook-dir  `pwd` &
    

    因为
    jupyter notebook --notebook-dir  . &
    

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

    关于command-line-interface - 如何从命令行启动 jupyter notebook 以在当前目录中运行,而无需编辑配置文件或传递硬路径?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/47878715/

    相关文章:

    javascript - 如何使用 Yargs 实现多个子命令?

    python - Tensorflow - 内核似乎已经死亡。它将自动重新启动

    jupyter-notebook - 如何将手写笔记添加到 Jupyter 笔记本?

    使用 nbconvert 将 Julia DataFrames 格式转换为 pdf

    javascript - 导入 iPython 自定义小部件函数(文件结构?)

    .net - Docker-dotnet-无法从入口点运行应用

    centos - 如何在 VPS 上设置 CentOS 端口转发?

    node.js - 如何通过 istanbul 全面覆盖 CLI NodeJS 应用程序?

    python - 导入gym时没有名为 'ale_py._ale_py'的模块 - Jupyter Notebook

    python - Jupyter Notebook 导入错误,%matplotlib qt