Reputation: 11272
I have a Jupyter Notebook .ipynb
file in my GitHub repository. It is supposed to show an image via the following markdown code:

The image does show up when the repository is public. However, when the repository is set to private, only the alternative caption "image" is visible and the image doesn't load. If I right-click on it and select "View Image", the image loads fine.
The issue also doesn't exist for .md
Markdown files: the same line above works for public and private repos.
There is this answer which describes how to embed images into the .ipynb
file, but that's not what I'm looking for. I want to display the .png
file dynamically.
Upvotes: 11
Views: 7810
Reputation: 1171
I found out that I only needed to do a simple copy an image Ctrl + C
and then paste into markdown cell with Ctrl + V
.
The link to an image should look something like this:

Only then the image became visible in my private repo! Something like the following DID NOT WORK for me:

Upvotes: 0
Reputation: 106
When I made my repo public, Github required me to confirm my credentials, but as soon as it was public, the images rendered. It could have been either so I'd suggest either logging out / in or making your repo public (then taking immediately private again if need be).
Upvotes: 2
Reputation: 1
I have tested most of the comments; however, only the following works for me:
.gitkeep
in the Image folder.<img src='Image/name.PNG' />
Upvotes: 0
Reputation: 4506
I struggled a lot, than at last was able to fix it.
Upvotes: 0
Reputation: 3288
As of 2015, Jupyter notebooks are rendered on GitHub using nbviewer. From this blog post they state:
Second, because of security concerns, some features available on nbviewer will not be available on GitHub. For example, GitHub will not render any dynamic output display that uses JavaScript, custom CSS, and most custom HTML embedded in Markdown or in outputs. When this is the case, and GitHub cannot fully render your notebooks, you will see an icon that allows you to view the full notebook on nbviewer.
An issue thread has some users saying that logging out/logging in will resolve the issue. Others say it is resolved over time. But there seems to be no recognized solution.
Upvotes: 2