notebook icon indicating copy to clipboard operation
notebook copied to clipboard

[bug] notebook can't display images, but lab can

Open Cosin777 opened this issue 3 years ago • 5 comments
trafficstars

Hello everone, Jupyter NoteBook can`t display image but same code works in Jupyter Lab.

My jupyter notebook version is 6.4.3

%%html <img src="1.jpg" />

In Chrome develop tool, network tab: Notebook requests url: http://<jupyter_url>/edit/1.jpg, with type text/html Lab requests http://<jupyter_url>/files/1.jpg, with type jpeg

Cosin777 avatar Jan 08 '22 01:01 Cosin777

downgrade to 5.5.0, everything works fine

Cosin777 avatar Jan 08 '22 01:01 Cosin777

Excuse me for cutting in, I have the same issue.

I use Jupyter. The Environmental is below.

MicrosoftTeams-image (1)

and tried the test that is written in here (https://github.com/jupyter/nbclassic/issues/89)

MicrosoftTeams-image (2)

I reproduce the same issue( can't see the local image file).

On the other hand, I downgrade Jupyter. The Environmental is below.

MicrosoftTeams-image (3)

and tried the same test.

MicrosoftTeams-image (4)

I can see the local image file.

Deriving from this, I think there were some changes between notebook versions 6.3.0 and 6.4.3. Is this correct behavior?

ivis-akaike avatar Aug 30 '22 07:08 ivis-akaike

This fixes the analogous issue for nbclassic. https://github.com/jupyter/nbclassic/pull/148

jedbrown avatar Sep 12 '22 13:09 jedbrown

I'm getting the same issue but downgrading notebook to 6.3.0 hasn't helped. I tried replicating @ivis-akaike 's environment and I get instead an internal issue with jinja (ImportError: cannot import name 'contextfilter' from 'jinja2').

ericspod avatar Sep 13 '22 18:09 ericspod

I tried nbclassic's update, but it does not work for my environment.

image

so, I check image's path.「edit」 is still added to URL.

https://github.com/jupyter/nbclassic/pull/148 other command is needed to reflect this pull request?

@ericspod my emviroment with notebook 6.3.0 looks like works well. (dont show jinja2 error message.) I’m sorry I couldn’t be much of a help. image

ivis-akaike avatar Sep 14 '22 02:09 ivis-akaike

For reference this seems to be working fine with Notebook 7 (currently in beta):

image

Normally the fix should be available in nbclassic for the classic notebook UI. Which means this issue could probably be considered as fixed then.

jtpio avatar Jun 08 '23 13:06 jtpio

Closing as this should be fixed with the latest versions of Notebook 7, JupyterLab and NBClassic.

Please have a look at the documentation to learn how to run the different UIs on the same Jupyter Server: https://jupyter-notebook.readthedocs.io/en/latest/migrating/multiple-interfaces.html

Feel free to re-open or open a new issue if needed, thanks!

jtpio avatar Jun 09 '23 08:06 jtpio

This does appear fixed in Notebook 7, thanks!

ericspod avatar Jun 11 '23 00:06 ericspod