Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Pyinstaller import #63

Closed
JacobBumgarner opened this issue Jan 10, 2022 · 4 comments
Closed

Pyinstaller import #63

JacobBumgarner opened this issue Jan 10, 2022 · 4 comments
Labels
question Further information is requested

Comments

@JacobBumgarner
Copy link

Hello,
I've built an application using pyinstaller that relies on imageio-ffmpeg for movie creation.

When freezing the application in a non-windowed manner, I was having no issue with writing movies. However, when building a -windowed application on macOS, I was getting an import error telling me that the writer couldn't establish a link to the file path.

I found that this issue could be simply solved by adding the following argument to a build command:

--hidden-import=imagio-ffmpeg

I wasn't sure where else to report this, but I figured I would share it here for any help.

I'm using pyinstaller==4.3 and imagio-ffmpeg==0.4.3

@almarklein
Copy link
Member

Putting import imagio_ffmpeg somewhere in your application (but not in an if) would probably also solve the issue.

Are you using imageio as the API (i.e. not imageio-ffmpeg directly)?

@JacobBumgarner
Copy link
Author

JacobBumgarner commented Jan 10, 2022

Ohhh interesting. I just added the import imageio_ffmepg line.

The issue was fixed with the hidden-import argument, so honestly I'm probably not going to test it without it at the moment. In the future when I have more free time I'll give it a test.

And correct, I'm using from imageio import get_writer

Thanks for the information! I'm not really sure how to deal with this post, as it's not an issue, but I thought it was worth sharing for someone who might experience a similar problem in the future. Thoughts?

@almarklein
Copy link
Member

And correct, I'm using from imageio import get_writer

Right, so because imageio does not explicitly import imageio_ffmpeg, pyinstaller is not sure whether it will actually be used and then acts in a conservative way by not including it. The --hidden-import or doing an explicit import should fix this.

It's indeed not technically a bug, but a good question nonetheless. I'm going to close it, and maybe Google will find it when someone with a similar question comes along :)

@almarklein almarklein added the question Further information is requested label Jan 10, 2022
@JacobBumgarner
Copy link
Author

JacobBumgarner commented Jan 13, 2022

Commenting to note that indeed, adding the import imageio_ffmpeg worked without the --hidden-import=imagio-ffmpeg arg. Thanks again @almarklein.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested
Projects
None yet
Development

No branches or pull requests

2 participants