0

Update

If I try downgrading from Pyinstaller 3.2 to 3.1 I instead get the following traceback when I try to run the executable.

enter image description here

I tried adding --hidden-import=collect_submodules('pkg_resources._vendor') to pyinstaller as noted here but it had no effect. Same error. This appears to be due to an issue with setuptools. I'm using 26.0.0. Downgrading to 19.3 that many sources say fixes the issue does indeed fix this issue but then I'm back to the issue I have below.


I have a python 2.7 pyqt4 project I'm trying to turn into an .exe using pyinstaller. I use:

pyinstaller --additional-hooks-rir=. --clean --win-private-assemblies pipegui.py

pipegui.py can be found on github here

I get a working executable and the app appears functional. Here is what the terminal spits while pyinstaller is freezing. However the app crashes when I run particular parts of my program. It crashes and the terminal goes in a loop continually outputting the same traceback below with "Poolworker-X" at the very top continually incrementing:

enter image description here

As you can see tkinter is implicated, despite the word "tkinter" appearing nowhere in my project (using pyqt4). I am making use of matplotlib though and from answers discussed here and here I have added the following to the top of pipegui.py my main script:

    from Tkinter import * 
    import Tkinter
    import FileDialog

This however seems to be a step in the wrong direction because after freezing with this (and the same flags as before) my executable wont even open and instead I get this:

enter image description here

Here is pyinstaller's pretty-much identical output while freezeing. Remember all I did was add those 3 import statements above. That's it.

I also tried pyinstaller --additional-hooks=. --clean --win-private-assemblies --hidden-import=Tkinter pipegui.py and it made no difference. I'm completely perplexed as to why trying to import tkinter is doing this. Will fixing this traceback lead me closer to solving the other?

I only figured out after trying all this that the only parts of my executable that are crashing are parts that make use of parmap multiprocessing. Classes that make use of matplotlib but not parmap are working fine.

So please note my question is how the first traceback can be fixed and also why are both matplotlib and tkinter popping up in the traceback despite my code where the crash occurs making use of niether?

Extra notes

  • I use --clean --win-private-assemblies to fix error code 14001 as per here
Community
  • 1
  • 1
Frikster
  • 2,755
  • 5
  • 37
  • 71
  • If you are using `pyinstaller 3.2`, [download the latest development version](https://pythonhosted.org/PyInstaller/when-things-go-wrong.html#getting-the-latest-version) and try again. You can also downgrade to `3.1`. – Repiklis Aug 25 '16 at 09:41
  • As far as I can tell 3.2 is the latest version so I assume you meant to say "If you are not using pyinstaller 3.2." When I try `pip install -e https://github.com/pyinstaller/pyinstaller/archive/develop.zip` I get `https://github.com/pyinstaller/pyinstaller/archive/develop.zip should either be a path to a local project or a VCS url beginning with svn+, git+, hg+, or bzr+` I downgraded to 3.1. Completely new ImportError now when trying to run the .exe (with 3.2 the .exe would open). See updates in question. – Frikster Aug 25 '16 at 18:16
  • So an hour later and I try pip install https://github.com/pyinstaller/pyinstaller/archive/develop.zip instead (so no -e flag as per the pyinstaller website). This installs the developer version and just like that fixes everything. If you put your solution below I will of course accept it. – Frikster Aug 25 '16 at 19:47
  • Glad to hear it worked. I've never used the `-e` switch and to be honest I never noticed it (oops). I think the development version works without the additional inputs, but for `3.1` you need to add them (not 100% sure though). If you have [PIL in your code](https://github.com/pyinstaller/pyinstaller/issues/877), only the development version worked for me. I'll post an answer below in a bit. – Repiklis Aug 26 '16 at 08:43

1 Answers1

0

Repiklis provided the solution in the comments. Further note that as of January 15 2017 Pyinstaller version 3.2.1 was released. I now use this and it solves this issue along with others like this and this that I could previously only solve by using the developer version. So I highly recommend upgrading to the latest version if you haven't already.

Community
  • 1
  • 1
Frikster
  • 2,755
  • 5
  • 37
  • 71