question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Images in the output cells are not being reflected to python code

See original GitHub issue

What is the issue?

When I run jupytext --to py my_notebook.ipynb to convert a notebook as a python file, it removes the information from the output cells (in this case some images are there as a hex string) and thus when I convert them back to ipynb using jupytext --to notebook my_notebook.py the produced .ipynb is not the same as the one I started with (it misses the images).

Which version am I using?

version - 1.6.0 (Installed from pip)

How to reproduce this?

I am attaching a .ipynb file with this issue report. If you do exactly what I said above (convert it to python and then convert it back to .ipynb) then you will see the final .ipynb file misses in the inline (output cell) images that the original .ipynb had. (because of Guthub’s issue of not letting me upload direct .ipynb files, I had zipped the original file)

Additional information

I am very new to jupytext. I tried to look online and in the documentation but could not find such a problem or anything like that. I am not sure what am I missing here. But maybe something. Please let me know if it is something trivial that I may have missed. In that case, I am sorry.

dream_exp.ipynb.zip

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:9 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
mwoutscommented, Nov 12, 2020

Great news! And thank you for your feedback. much appreciated!

1reaction
mwoutscommented, Nov 10, 2020

When you convert the .ipynb to .py in the first place it does not put any information about images in the .py file

Agreed! The .py or .md files don’t include the outputs - we don’t want them to be as big as the .ipynb files.

But again, jupytext --sync or jupytext --to ipynb --update will preserve the outputs that exist in the .ipynb file, so it is indeed possible to work on the .py file, and propagate that work to the .ipynb file without loosing the outputs.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Why is IPython.display.Image not showing in output?
I have a cell that looks like this:
Read more >
Image Processing with Python - Data Carpentry
This lesson introduces an open source toolkit for processing image data: the Python programming language and the scikit-image ( skimage ) library.
Read more >
Getting images and code into a post here - Python Help
I am pasting a jpg into this post (below) it shows a line of text. I am hoping that when I post the...
Read more >
Jupyter Notebook 6.5.2 documentation - Read the Docs
When a code cell is executed, code that it contains is sent to the kernel associated with the notebook. The results that are...
Read more >
5 Simple Ways to Insert Google Sheets Images
The above formula gives the result as shown below: Since I have not provided any of the optional arguments, it will insert the...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found