I was planning to use the "jupyter_to_medium" library so I can focus on getting my Jupyter Notebooks in good shape including plots, pictures, dataframes generated properly and lots of wording explaining the work, so then I can publish it directly to Medium with not much hassle.
I'm following this article for setting up the library and steps required: https://medium.com/dunder-data/jupyter-to-medium-initial-post-ecd140d339f0
I'm currently running Ubuntu under Windows Linux Subsystem and the issue I'm currently having is not being able to render cell outputs that are plots or dataframes etc... I've checked and installed all the dependencies mentioned (Chrome, Requests, nbconvert and Pillow - I have them all and working) but when I try to publish, I get the intermediate screen from medium and then on the final step when I hit the publish button I get the following error:
Failed to post to MediumReturned error message below"cannot identify image file <_io.BytesIO object at 0x7f341c2bf650>"
Failed to move to new namespace: PID namespaces supported, Network namespace supported, but failed: errno = Permission denied
Failed to generate minidump.cannot identify image file <_io.BytesIO object at 0x7fdd1f99e8f0>
For some reason it cannot take a screenshot and render the cell outputs that are pictures or dataframes.
Any other pictures that I've created manually to enhance the document (e.g. the logo of my article or others), are read properly and loaded, but any code generated ones (pandas, bar chart races, etc...) are not.
1) I wonder if I've missing something else or has to do with the fact that I'm running Ubuntu under Windows Linux Subsystem and not native? i.e. it cannot take a screenshot via Chrome as it runs under windows?
i.e. when I run jupyter-notebook
from ubuntu command line it still gives me a URL to run on windows but I also get the message:
No web browser found: could not locate runnable browser.
, so I have to launch Jupyter manually on windows.
2) If that's the case, would that be the reason it can't take a screenshot of the output. Somewhere in the article it says:
"Pandas DataFrames are converted to images Medium does not support tables, such as those produced in output cells by pandas DataFrames. As a workaround, these tables are uploaded as images captured by the Chrome browser’s screenshot ability. In the following code cell, the bar_chart_race package is used to import a pandas DataFrame containing deaths from COVID-19 in several countries. It is embedded in the Medium post as an image."
I don't know how else to make this work, but any suggestions would be great as it seems to be a great tool?
Thanks Angelo
CORRECTION on Question 1 - I have now made that work by doing the following from this thread: https://stackoverflow.com/a/62275339/11141700 . So this wasn't the issue, as I'm still getting the same error when trying to publish on Medium with Pandas frames and plots in cells output.