You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Problem importing imageio_ffmpeg in frozen applications #766
I see this issue with imageio 2.16.1
I don't see this issue with imageio 2.10.3
This might have been caused by bdbe699 (which appeared first in imageio 2.11).
For some reason imageio cannot import the imageio_ffmpeg module in frozen applications anymore.
This is the imageio-related traceback that I get:
File "imageio\core\functions.py", line 98, in get_reader
File "imageio\core\imopen.py", line 332, in imopen
ValueError: Could not find a backend to open `C:\Users\Paul\Downloads\fmt-tdms_fl-image-bright_2017\M4_0.040000ul_s_imaq.avi`` with iomode `r?`.
Based on the extension, the following plugins might add capable backends:
FFMPEG: pip install imageio[ffmpeg]
I checked an imageio_ffmpeg got bundled into the application.
Interesting. We recently added a section on freezing to the docs (thanks again @richardsheridan ). Did you account for what is written there? I.e., did you make sure that pyinstaller ends up including the ffmpeg plugin file? (Should be in imageio/plugins/ffmpeg.py)
No, I didn't. Why don't you add those plugins to the imageio pyinstaller hook? From the docs I understand they are light-weight, so I guess this would be the best choice.
Why don't you add those plugins to the imageio pyinstaller hook?
Lack of knowledge from my side. If it's possible to add them automatically, I'm happy to have that added; however, I never used pyinstaller myself so I don't know what would be needed to accomplish that. I could - of course - spend the time and learn, but that time currently goes to other issues with higher priority.
That said if you would like to submit a PR that adds this, I'm happy to review.
I created the PR for PyInstaller. It might make sense to update the docs section on freezing with a note that there are hooks for imageio (including plugins) and imageio_ffmpeg and everything that does not require any additional binaries should just work with pyinstaller-hooks-contrib version greater than 2022.2.
Thanks for your help. I think if the PR is merged in the current state, it should definitely be mentioned in the ImageIO docs that building an app with PyInstaller should be done in a clean Python environment with only the packages installed needed for the required plugins.
Thanks for picking this up, I had decided not to make the pyinstaller PR because I don't have any use cases for imageio_ffmpeg or others so I wouldn't have been able to tell if I really did it right 😅
Activity
FirefoxMetzger commentedon Mar 15, 2022
Interesting. We recently added a section on freezing to the docs (thanks again @richardsheridan ). Did you account for what is written there? I.e., did you make sure that pyinstaller ends up including the ffmpeg plugin file? (Should be in imageio/plugins/ffmpeg.py)
paulmueller commentedon Mar 15, 2022
No, I didn't. Why don't you add those plugins to the imageio pyinstaller hook? From the docs I understand they are light-weight, so I guess this would be the best choice.
FirefoxMetzger commentedon Mar 15, 2022
Lack of knowledge from my side. If it's possible to add them automatically, I'm happy to have that added; however, I never used pyinstaller myself so I don't know what would be needed to accomplish that. I could - of course - spend the time and learn, but that time currently goes to other issues with higher priority.
That said if you would like to submit a PR that adds this, I'm happy to review.
paulmueller commentedon Mar 15, 2022
OK. I can do that. The PR would be with Pyinstaller. I will let you know here. Please keep this open in the meantime.
paulmueller commentedon Mar 15, 2022
I created the PR for PyInstaller. It might make sense to update the docs section on freezing with a note that there are hooks for imageio (including plugins) and imageio_ffmpeg and everything that does not require any additional binaries should just work with pyinstaller-hooks-contrib version greater than 2022.2.
FirefoxMetzger commentedon Mar 15, 2022
Thanks @paulmueller . I saw the PR and left two comments :) Once that is merged upstream I will make an update to our docs.
paulmueller commentedon Mar 15, 2022
Thanks for your help. I think if the PR is merged in the current state, it should definitely be mentioned in the ImageIO docs that building an app with PyInstaller should be done in a clean Python environment with only the packages installed needed for the required plugins.
richardsheridan commentedon Mar 15, 2022
Thanks for picking this up, I had decided not to make the pyinstaller PR because I don't have any use cases for imageio_ffmpeg or others so I wouldn't have been able to tell if I really did it right 😅