Why can't I import Pillow in other addons when its used in ayon-core?

I noticed ayon-core has Pillow in it’s pyproject.toml under:



Pillow = "9.5.0"

But I can’t seem to import it:
from PIL import Image, ImageDraw, ImageFont

results in an Import Error.

Am I missing something about the architecture of AYON? Am I required to make a dependency package with Pillow in the pyproject.toml of my specific addon and for each addon that needs it?

Thanks in advance for the help!

As far as I know, when you create a depenency package, upload it to your server and assign it to your bundle. Then, once you run the launcher, the depenency is added to your running session.

As you have mentioned that Pillow actually exists. Then, when running the script in an AYON initialized environment, it should work. e.g. running the import code in AYON console.


Personally, to ease up my day to day dev work, I added the depenency package to my python search paths in VS code so that I don’t get warnings or errors in my code editor.