question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Jupyter Notebook: pictures from up directories are not shown

See original GitHub issue

Expected/actual behavior

I work with Jupyter Notebook in VS Code and insert picture in Markdown field. If picture is in the same folder as .ipynb file or directory down - everything is working fine. But pictures from up directories are not shown. Browser version of Jupyter Notebook works fine. And if I run python script in VSC and try to open file from up directories it’s working too. Is it a bug? I changed paths & slashes, terminal paths, notebook (Python > Data Science) settings, swithed between conda and “usual” python and it doesn’t help.

Steps to cause the bug to occur

For example I have project in D:/Project folder. Notebook is inside “./scriptFolder” and I’m inserting several images. Pics from notebook folder and directories down are shown, other not. With tree it looks like this:

Project
|----dataFolder
|    |----data.txt
|    |----vsData.jpg (this pic is not shown)
|----scriptFolder
|    |----pic
|    |    |----vsDown.jpg (this pic is shown)
|    |----jNotebook.ipynb (our notebook)
|    |----vs.jpg (this pic is also shown)
|----vsUp.jpg (this pic is not shown)

I run this scripts:

# %% [markdown]
<img src="./vs.jpg" /> (shown)
<img src="./pic/vsDown.jpg" /> (shown)
<img src="./../vsUp.jpg" /> (not shown)
<img src="./../dataFolder/vsData.jpg" /> (not shown)

# %%
f = open("./../dataFolder/data.txt","r")
print(f.read()) 

GIF version

JupNotIssue

Jupyter and/or Python environment

  • Jupyter server running: Local
  • Extension version: Python 2020.3.71659
  • VS Code version: 1.44
  • Python/Anaconda version: 3.7.6(+3.8.2)/2020.02
  • OS: Windows
  • Virtual environment: N/A

Microsoft Data Science for VS Code Engineering Team: @rchiodo, @IanMatthewHuff, @DavidKutu, @DonJayamanne, @greazer

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:8 (5 by maintainers)

github_iconTop GitHub Comments

1reaction
rchiodocommented, Apr 21, 2020

Validated. Should be in our released bits.

1reaction
dsidovcommented, Apr 11, 2020

Wow, thanks a lot! You’re doing a great job!

Read more comments on GitHub >

github_iconTop Results From Across the Web

Jupyter Notebook: pictures from up directories are not shown ...
I work with Jupyter Notebook in VS Code and insert picture in Markdown field. If picture is in the same folder as .ipynb...
Read more >
Image not appearing in ipython notebook when in a non-sub ...
When I run ipython notebook inside the notebooks folder the images don't render (markdown or html). They do render, as in your case, ......
Read more >
Jupyter Not Finding Folders - General
I have a github project that I cloned to my home pc, but when I try to open it with Jupyter it only...
Read more >
Jupyter markdown images not showing - Julia Discourse
I have tried to follow all the possible ways of inserting images into Markdown cell in Jupyter Notebooks, but I can't get anything...
Read more >
3 Ways to Add Images to Your Jupyter Notebook - Essi Alizadeh
We can add images from your local drive by providing the path to the file. from IPython import display display.Image("./image.png").
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found