【问题标题】:Spyder Notebook Python 2.7Spyder 笔记本 Python 2.7
【发布时间】:2016-06-18 20:12:15
【问题描述】:

我正在使用 anaconda 2 中的 spyder notebook。我的代码的第一行是:

get_ipython().magic('matplotlib inline')

返回以下错误信息

 get_ipython().magic('matplotlib inline')
NameError: name 'get_ipython' is not defined

我是 python 新手,所以任何帮助都将不胜感激。

【问题讨论】:

    标签: python python-2.7 ipython anaconda spyder


    【解决方案1】:

    你需要先从IPython模块导入get_ipython

    【讨论】:

    • 我尝试将 import IPython 添加到我的代码的第一行。我需要添加其他内容吗?
    • 从 IPython 导入 get_ipython
    猜你喜欢
    • 2020-04-07
    • 2017-10-30
    • 2020-03-19
    • 2016-11-18
    • 2017-08-02
    • 2020-03-20
    • 1970-01-01
    • 2020-05-16
    • 2013-07-30
    相关资源
    最近更新 更多