My question is very simple but I'm have a great deal of a time trying to figure it out. I am making an exe file using pyinstaller and have to add poppler to it so I can run pdf2image successfully. I have read all the answers online but still can't figure out how to add it to the exe. I have added the .dll's to the same directories that the exe is running and it still flashes the same error when I run the exe saying that it can't find poppler and asks if poppler is in the path. Also I have tried to use the --add-binary/--add-data function when setting up and making the exe and both solutions dont work. I am open to any solution no matter how messy or complicated it is I just want to figure this out so I can move on to the next steps in the project I'm working on.
Asked
Active
Viewed 126 times
0
-
1Try this approach (and take careful note of the way that they handle the asset path using `sys.MEIPASS`): https://stackoverflow.com/questions/51264169/pyinstaller-add-folder-with-images-in-exe-file/51266275 Not 100% sure it will fix your problem, but it seems like a possibility. – DivideByZero Aug 16 '21 at 17:55
-
I looked at it but still don't understand what I have to do in order for my exe to find poppler. – Noah Lehman Aug 16 '21 at 19:46
-
The `.exe` loads its dependencies from a temporary directory (*not* the one where the `.exe` is running). Consult the docs on how to set up a `.spec` file to do what you want. There is also a very helpful section there called *When things go wrong.* There are quite a few things that can go wrong, so you will need to work through it. – BoarGules Aug 16 '21 at 20:53