错误:找不到行魔术函数`%matplotlib` [英] ERROR: Line magic function `%matplotlib` not found
问题描述
我是未加工的新手中最原始的.我刚刚按照 http://ipython.org/install.html ,没有明显的错误.我现在想按照示例笔记本的方式工作.在笔记本第1部分-运行代码"中,一切正常,直到我进入
I am the rawest of raw newbies. I have just installed IPython on a Mac (MacOS 10.7.5) following the instructions for anaconda on http://ipython.org/install.html, with no obvious errors. I now want to work my way through the example notebooks. In notebook "Part 1 - Running Code", everything works as it should until I get to
%matplotlib内联
%matplotlib inline
然后我收到错误消息
错误:找不到线魔术函数%matplotlib
.
ERROR: Line magic function %matplotlib
not found.
此后一切正常,除了绘图以外,在新窗口中弹出而不是内联显示.
Everything after that works, except that plots, instead of appearing inline, pop up in a new window.
推荐答案
尝试:
import IPython
print(IPython.sys_info())
它是否报告您使用的是'ipython_version'
1.0+?
您可能正在选择没有%matplotlib
魔术的IPython的较早版本.
Does it report that you are on 'ipython_version'
1.0+?
You might be picking up an older version of IPython that do not have the %matplotlib
magic.
这篇关于错误:找不到行魔术函数`%matplotlib`的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!