我的 GitHub 存储库中有一个 Jupyter Notebook .ipynb
文件。它应该通过以下 Markdown 代码显示图像:
![image](image.png)
当存储库公开时,图像会显示。但是,当存储库设置为私有(private)时,只有替代标题“图像”可见并且图像不会加载。如果我右键单击它并选择“查看图像”,图像加载正常。
.md
Markdown 文件也不存在此问题:上面的同一行适用于公共(public)和私有(private)存储库。
有this answer它描述了如何将图像嵌入 到.ipynb
文件中,但这不是我要找的。我想动态显示 .png
文件。
最佳答案
截至 2015 年,Jupyter notebooks are rendered on GitHub using nbviewer .他们在这篇博文中指出:
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.
安issue thread有一些用户说注销/登录将解决问题。其他人说它会随着时间的推移而解决。但似乎没有公认的解决方案。
关于python - Jupyter Notebook 中的图像 ipynb 未显示在 GitHub 私有(private)仓库中,但相同的代码适用于公共(public)仓库,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/55751415/