A month ago I solved my applcation freezing issues for Python 2.7 as you can see here. I have since adapted my code to python 3.5 (using Anaconda) and it appears to be worki
This still looks like an issue, which is why I'm resurrecting this old post in the event someone like me googles for a fix to the same issue.
You don't need to uninstall or reinstall anything. I just installed latest version of Anaconda and pyinstaller and have come across the same error again.
The problem is the ../Anaconda3\Lib\site-packages\PyInstaller\utils\hooks\qt.py file.
The solution lies in the following link. https://github.com/pyinstaller/pyinstaller/issues/3938
json_str = exec_statement("""
# ... some code here ...
else:
# QLibraryInfo isn't always valid until a QCoreApplication is
# instantiated.
app = QCoreApplication(sys.argv) # this is the part that's needed
I hope the pyinstaller devs fix this at some stage.
Uninstall Anaconda and everything works... I conclude that you simply cannot have Anaconda installed and use the standard Python 3.5 compiler at the same time if you're using Pyinstaller. Maybe this is related.
This is not the first time that uninstalling Anaconda appears to solve my issues... If I should report this issue somewhere please comment below. I don't know where.
[specifically for an anacodna installation] I had the same problem, but it got fixed when I updated anaconda.
From the Anaconda prompt: conda update anaconda
. This updates several packages including pyqt
I managed to fix the same problem I encountered (conda 4.5.4, pyinstaller 3.4) without uninstalling conda:
pip install PyQt5
conda already installed PyQt when I used conda install jupyter seaborn
. Interestingly, using conda install PyQt5
does not fix my problem. I don't know why. In any case I hope this may help someone out there.
I think there is an issue with the current version of pyinstaller. I uninstalled the default version.
pip uninstall pyinstaller
and installed the latest trial version
pip install https://github.com/pyinstaller/pyinstaller/archive/develop.zip
and then it worked for me.
More information here: https://github.com/pyinstaller/pyinstaller/issues/3938
What worked for me (whicle trying to convert to .exe a script named main.py ) is a variation of kierabeth. More specifically the following:
first create a spec file and exclude the PyQt5 module
pyi-makespec --onefile main.py --exclude-module PyQt5
then build the spec file
pyinstaller main.spec