# Adding image to the node in python not working

**URL:** <https://forum.graphviz.org/t/adding-image-to-the-node-in-python-not-working/2332>\
**Category:** Help\
**Created:** [July 12, 2024, 8:14am UTC](https://forum.graphviz.org/t/adding-image-to-the-node-in-python-not-working/2332 "2024-07-12T08:14:28Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Janusz](https://avatars.discourse-cdn.com/v4/letter/j/76d3ee/32.png) [@Janusz](https://forum.graphviz.org/u/Janusz)\
**Post date:** [July 12, 2024, 8:14am UTC](https://forum.graphviz.org/t/adding-image-to-the-node-in-python-not-working/2332/1 "2024-07-12T08:14:28Z")

</div>

Hi,  
I am trying to add an image (the image exists in the same folder) directly from the Python code and I am getting the following error:

_graphviz.backend.execute.CalledProcessError: Command ‘[WindowsPath(‘dot’), ‘-Kdot’, ‘-Tpdf’, ‘-O’, ‘test.gv’]’ returned non-zero exit status 1. [stderr: b’Warning: “1.jpg” was not found as a file or as a shape library member\r\nError: No or improper image file=“1.jpg”\r\nin label of node struct3\r\n’]_

The code is simple:

```auto
import graphviz
import os

g = graphviz.Digraph('tree', filename='test.gv', node_attr={'shape': 'plaintext'})

g.node('struct3', '''<
<TABLE BORDER="0" CELLBORDER="1" CELLSPACING="0" CELLPADDING="4">
  <TR>
    <TD ROWSPAN="3"><IMG SRC="1.jpg"/></TD>
 </TR>
</TABLE>>''')

g.view()

```

---

<div class="post-metadata">

**Author:** ![steveroush](https://avatars.discourse-cdn.com/v4/letter/s/a9adbd/32.png) [@steveroush](https://forum.graphviz.org/u/steveroush)\
**Post date:** [July 12, 2024, 4:46pm UTC](https://forum.graphviz.org/t/adding-image-to-the-node-in-python-not-working/2332/2 "2024-07-12T16:46:44Z")

</div>

Somewhat common problem. Does this help? ([Unable to render images](https://forum.graphviz.org/t/unable-to-render-images/1823))
