'Transferring .py file to .exe with pyinstaller, EXE file show error with PySide2 (has no attribute 'QtPrintSupport')

i'm creating a calculato in python. I'm trying to convert the final version to executable. Transfer with pyinstaller is going okay. It creates an .exe file, but when i start .exe file, it shows this error:

Error showed when starting .exe

In file "calculator.py" line 10 is:

from PySide2 import *

When i turn it on as a python file, it works properly. I can't find what is causing this error.



Solution 1:[1]

Have you tried to run pyinstaller in a clean enviroment with only the necessary libaries. Pyinstaller tend to use installed libaries in the enviroment this makes the files larger and slower to run and can give errors. It has solved most of my pyinstaller issues. I hope this helps.

Solution 2:[2]

As suggested by comments, problem was solved by cutting which parts of library i was using and only adding those to the code. So final import looked like this:

from PySide2 import QtGui, QtWidget

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 Christoffer
Solution 2 Richard Harman