Jupyter Notebook ipynb中的图像未显示在GitHub私有存储库中,但相同的代码可用于公共存储库 [英] Image in Jupyter Notebook ipynb doesn't show up in GitHub private repo but the same code works with public repo

查看:157
本文介绍了Jupyter Notebook ipynb中的图像未显示在GitHub私有存储库中,但相同的代码可用于公共存储库的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我的GitHub存储库中有一个Jupyter Notebook .ipynb文件.应该通过以下降价代码显示图像:

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

![image](image.png)

当存储库为公共存储库时,该图像确实显示.但是,当存储库设置为私有时,仅备用标题"image"可见,并且不会加载该图像.如果我右键单击它并选择查看图像",则该图像会很好地加载.

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.

.md Markdown文件也不存在此问题:上面的同一行适用于公共和私有存储库.

The issue also doesn't exist for .md Markdown files: the same line above works for public and private repos.

此答案,其中描述了如何将图像嵌入.ipynb文件中,但是那不是我要找的东西.我想动态显示.png文件.

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.

推荐答案

截至2015年,

As of 2015, Jupyter notebooks are rendered on GitHub using nbviewer. From this blog post they state:

第二,由于安全问题,nbviewer上的某些功能将在GitHub上不可用.例如,GitHub不会渲染任何使用JavaScript,自定义CSS和Markdown或输出中嵌入的大多数自定义HTML的动态输出显示.在这种情况下,并且GitHub无法完全渲染您的笔记本,您将看到一个图标,可让您在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.

问题线程中有一些用户说注销/登录将解决问题.其他人则说,随着时间的流逝,它得到了解决.但是似乎没有公认的解决方案.

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.

这篇关于Jupyter Notebook ipynb中的图像未显示在GitHub私有存储库中,但相同的代码可用于公共存储库的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆