I'm testing a python program, which contains calling for IPython. But I got errors in the following code: If I use
%matplotlib inline
I got a syntax error at the "%" symbol. I found a solution to this problem using:
from IPython import get_ipython
get_ipython().run_line_magic('matplotlib', 'inline')
I got error saying:
AttributeError: 'NoneType' object has no attribute 'run_line_magic'
I'm using Ubuntu 16.04 and running the code via command line. How can I fix this ?
pythonoripython? I would suggest you to usejupyter notebook.%matplotlib inlineis used to render plots inline in ipython notebooks. If you are running this as a script from command line, try with this line commented.