Search code examples
python-3.xtkinterpyinstallerexe

Tkinter video player library works fine as script but has issue when converted into an exe. (Failed to execute script due to unhandled exception)


I wrote a python program that uses the library tkVideoPlayer (and others). The python script runs fine without any errors but when I use pyinstaller to convert it into an exe, the exe doesn't run at all and I get the following error. (see image)

Things I have tried already:

  • Locating the file and moving it to the folder my exe is in.
  • Using a star import for the library
  • Using the --hidden option when creating the exe and specifying av/av.libs

Error message when attempting to run the exe.


Solution

  • Issue occurred due to me using Anaconda 3 (Sypder). It was using a virtual Environment and pyinstaller failed to locate the library correctly.

    Solution: Installed python 3 directly onto windows, then installed pyinstaller and and all the libraries I used. Since that isn't a virtual environment it worked fine and the exe ran perfectly.