【问题标题】:UsageError: Line magic function `%` not found. Jupyter NotebookUsageError: 找不到行魔术函数 `%`。 Jupyter 笔记本
【发布时间】:2019-03-23 06:37:12
【问题描述】:

我的 Jupyter Notebook 的以下行出现错误

% matplotlib inline

我使用的是 Python 3.7 版,ipython 7.0.1 版

【问题讨论】:

    标签: python-3.x jupyter-notebook ipython


    【解决方案1】:

    将其拼写为两个词,而不是三个词:%%matplotlib inline

    【讨论】:

      【解决方案2】:

      把它拼成两个词,而不是三个:

      %matplotlib inline
      

      【讨论】:

      • 好的,这行得通,但是为什么呢?在我的测试中,Unix 接受了 3,而 Windows 接受了 3。如果这在所有情况下都是正确的,那么 Win 是什么。 vs Linix/Unix 与 jupyter 导致此错误?
      • 对于 Ubuntu 18.04、Python 3.8 和 iPython 7.19,它实际上需要两个词,而不是三个。
      • 谢谢!我只是在做一个 Udacity 教程,在教程中,他们使用了“错误”版本(% matplotlib inline)。
      猜你喜欢
      • 2020-04-18
      • 2021-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2020-04-07
      相关资源
      最近更新 更多