nbconvert: `%matplotlib inline` fails when converted to script
This might be known, but didn’t see a bug for it. Consider a notebook test.pynb
containing the magic %matplotlib inline
and converted to a script test.py
:
jupyter nbconvert --to script test.ipynb
test.py
now looks like
get_ipython().magic('matplotlib inline')
However, get_ipython()
is undefined and the script will be unusable. nbconvert version 5.0.0
About this issue
- Original URL
- State: open
- Created 8 years ago
- Reactions: 15
- Comments: 41 (15 by maintainers)
I write
'exec(%matplotlib inline)'
instead ofget_ipython().magic('matplotlib inline')
I don’t get any error, but there is no output I mean there is no output images.
Anyone can fix it please ???
slightly off topic - but hypothetically - using iterm - someone could rig up the terminal to actually show image at the command line. Here’s the heavy lifting already done - just need to call out from python to command line https://github.com/johndpope/terminal-image-cli Examples $ image unicorn.jpg $ cat unicorn.jpg | image
I’m not sure that would work… but if you try running it using ipython as your interpreter (
ipython your_file.py
instead ofpython your_file.py
) does that work?On Wed, Dec 28, 2016 at 10:56 Jacob Peacock notifications@github.com wrote: