Looping Issue in PyInstaller Packaged FastAPI App with Torchvision Dependency

I’m working on a FastAPI application that uses Torchvision for image processing. The application is packaged using PyInstaller

When I run the compiled .exe, I receive a warning from Torchvision about failing to load the image Python extension, and then the application seems to enter an infinite loop

‘’’ torchvision\io\image.py:13: UserWarning: Failed to load image Python extension: '‘If you don’t plan on using image functionality from torchvision.io, you can ignore this warning. Otherwise, there might be something wrong with your environment. Did you have libjpeg or libpng installed before building torchvision from source? ‘’’

How can I ensure that all necessary binaries for Torchvision are correctly included in the PyInstaller bundle? Are there any known issues with Torchvision and PyInstaller compatibility