Reputation: 313
i have installed vscode with official microsoft python package , every thing is ok except images rendering in markdown
i tried the following codes for displaying images in markdown cell :
<img src="images/grad_summary.png" style="width:600px;height:300px;">
alt

but it is not working although it is working on jupyter notebook
P.S.
vscode version: 1.40.1
python version : 3.7
vscode python extension version : 2019.10.44104
os : windows 10
Any Help :)
Upvotes: 12
Views: 28215
Reputation: 811
First you can drag a picture from VS Code file explorer and then dropping it in a Markdown cell holding shift
button.
If you still having problems displaying the image, try to delete everything written in the file link except the picture's name. In your case you would have something like this:

Upvotes: 1
Reputation: 1

# 
Work with me
Upvotes: 0
Reputation: 85
<img src="images/grad_summary.png">
works for me now
vscode info
Version: 1.74.3 (user setup)
Commit: 97dec172d3256f8ca4bfb2143f3f76b503ca0534
Date: 2023-01-09T16:59:02.252Z
Electron: 19.1.8
Chromium: 102.0.5005.167
Node.js: 16.14.2
V8: 10.2.154.15-electron.0
OS: Windows_NT x64 10.0.19044
Sandboxed: No
Jupyter extension: v2022.11.1003412109
Upvotes: 0
Reputation: 1
As of 31/05/2022, If you initially create the file in Jupyter Notebook and later open it in VC Code, the code for embedding the picture is:

Just delete 'attachment:' (to express the reference in the right format)

and the picture will load. (given the reference/path to it is still valid)
Upvotes: 0
Reputation: 170
%matplotlib inline
from IPython.display import Image
Image('image_path')
Upvotes: 8
Reputation: 554
This is a known issue with local paths to images: https://github.com/microsoft/vscode-python/issues/7704
Unfortunately there is no workaround.
Upvotes: 1