Python Pillow and PSUtil doesnot work with OSMC

I am trying to display an image and then close the image viewer using python script that uses Pillow and PSUtil. It works fine on ubuntu, but it doesnot run on the latest osmc.
Can you please suggest/point out what I am doing wrong. Below is a small script that I ran on ubuntu.

import time

import psutil
from PIL import Image

# open and show image
im ='test.png')

# display image for 10 seconds

# hide image
for proc in psutil.process_iter():
    if == "display":

I assume this would require an X Server to display the image, or?

Triggering an addon ?Is it possible by python ?

You mean triggering a Kodi addon via python? For sure it’s possible