I am writing the following Python 3.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, it gives the following Fatal Error Message: "Failed to execute script [script-name]".
If someone has an idea 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.
Windows10 (64 bit), Python 3.5(32 bit), PyInstaller(3.2), PyQt4
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 the codes above doesn't solve your problem.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With