Home > OS >  How to reference an image in markdown that is on my local drive?
How to reference an image in markdown that is on my local drive?

Time:11-03

I tried to add an image from a local drive to markdown in a Jupyter notebook in Visual Studio Code, but I am unable to do so.

I have followed the guidance of hovering over the image tab to see the path it is trying to resolve

Notice how butchered that path is. Thus, you need to use relative paths to the file. In this example, you can do:

![My Test Image](../MyImage.jpg)
*My Test Image*

This will resolve to C:/dev/MyImage.jpg. Depending on how deep your file is in a folder structure, you may need to go further back (so maybe something like ../../..MyImage.jpg).

Visual Studio Code will even try to autocomplete paths if it can like so:

Visual studio Code showing path suggestion to image

  • Related