Monday, June 20, 2016

PyQt4 script frozen by PyInstaller gives Fatal Error:“Failed to execute script pyi_rth_qt4plugins”

Leave a Comment

I am writing the simple following py3.5 script:

import sys from PyQt4 import QtGui   class Window(QtGui.QMainWindow):      def __init__(self):         super().__init__()         self.setGeometry(50, 50, 500, 300)         self.setWindowTitle("HelloGUI")         self.show()   def run():     app = QtGui.QApplication(sys.argv)     win = Window()     sys.exit(app.exec_())  run() 

I create executable using PyInstaller. It runs normally. Though when I try to run the executable on a different pc (which has no python installed) than mine, gives the following Fatal Error Message: "Failed to execute script pyi_rth_qt4plugins".

If someone has an idea of how i can make my gui programms portable, please leave a comment. Otherwise, if what i have in my mind cannot be done, please let me know. Thanks in advance!


Windows10 (64 bit)

py3.5(32 bit)

PyInstaller(3.2)

PyQt4

1 Answers

Answers 1

I solved my issue using --noupx when I use pyinstaller. [PyQt5-Python 3.4]

Example;

pyinstaller.exe --onefile --windowed --noupx --icon=app.ico myapp.py 

Check this.

If You Enjoyed This, Take 5 Seconds To Share It

0 comments:

Post a Comment