pyinstaller packaged .exe program running on another computer error

 

 

 

 

 

In general, that is some version pyqt5 library load of system variables exist bug, the specific reasons only official to explain, we are unable to control, and provide a way to have a bug repository that is, in the main program pyqt5 on the system variables set manually before library import, import code is as follows:

import sys, os
if hasattr(sys, 'frozen'):
os.environ['PATH'] = sys._MEIPASS + ";" + os.environ['PATH']
from PyQt5 import QtCore, QtWidgets, QtGui
from PyQt5.QtWidgets import *
from untitled import Ui_MainWindow
from PyQt5.QtGui import *

 

After this package can be the perfect run exe



Original: https: //blog.csdn.net/zwyact/article/details/99778898

 

Guess you like

Origin www.cnblogs.com/wisir/p/11515211.html