【问题标题】:How to use "jupyter-run" to call a jupyter notebook on local?如何使用“jupyter-run”在本地调用 jupyter notebook?
【发布时间】:2020-02-06 18:21:42
【问题描述】:

我正在尝试使用 anaconda 提示符调用 jupyter notebook Untitled.ipynb jupyter-run Untitled.ipynb 我收到错误消息“NameError: name 'null' is not defined。我该如何解决这个问题?

【问题讨论】:

  • 您能否提供您尝试运行的确切命令以及文件结构?
  • 看看答案here
  • @joe-fivefifty 确切的命令是“jupyter-run Untitled.ipynb”,笔记本只包含一行“print('hello')”。
  • 谢谢@funie200;如果我想将我的 .ipynb 转换为 .py,您提到的答案真的很有帮助:从 anaconda 提示符运行“jupyter-run Untitled.py”工作正常。问题在于,根据 Jupyter Runner 文档(请参阅 pythonhosted.org/jupyter_runner),“Jupyter runners 允许在多组参数上运行多个笔记本”,他们的使用示例是“jupyter-run notebook.ipynb”。这正是我正在尝试使用的代码,但它不起作用(请参阅上面的错误)。

标签: python jupyter-notebook jupyter jupyter-lab


【解决方案1】:

jupyter-run 是在 jupyter 内核中运行 scripts 的命令:

jupyter run script.py
curl https://example.com/some_r_script.R | jupyter run --kernel=ir

要执行一个notebook,你可以使用

jupyter nbconvert --execute notebook.ipynb

【讨论】:

    猜你喜欢
    • 2021-03-08
    • 2019-01-24
    • 1970-01-01
    • 2020-08-30
    • 2017-06-06
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2021-07-24
    相关资源
    最近更新 更多