3
votes

I have two Python scripts which produces a GUI and runs code off some of the buttons. When run from Python, I run mainImpactTool.py which then runs impactTool.py to produce the GUI.

  • mainImpactTool.py
  • impactTool.py

I followed the guidance here:

https://pythonhosted.org/PyInstaller/usage.html#what-to-bundle-where-to-search

So I could create a single executable for running on Windows.

If I had one script I would normally run:

Pyinstaller --onefile mainImpactTool.py

However, to use two scripts, I did this:

Pyinstaller --onefile mainImpactTool.py impactTool.py

Pyinstaller works, but when I run the .exe file I get the error:

ImportError ... Failed to execute script mainImpactTool

Any suggestions on what I am doing wrong?

Thank you

1
Just import the desired scripts into your projects with regular import and pyInstaller will take care of the rest. - Pedro Lobito

1 Answers

3
votes
Pyinstaller --onefile mainImpactTool.py

Try this it will work. Pyinstaller will recurse over all your imports(impactTool.py) and include it in the .exe.