title: .UI converted to .Py falls in PyInstaller application
body: <p>I try to release python application, that uses Qt gui. To deploy app in fast and python-free way i used Pyinstaller
  I converted my UI to py.</p>
  
  <p>class Ui_MainWindow(object):</p>
  
  <pre><code>def setupUi(self, MainWindow):
      MainWindow.setObjectName("MainWindow")
      MainWindow.resize(362, 669)
      self.centralwidget = QtWidgets.QWidget(MainWindow)
      sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Preferred, QtWidgets.QSizePolicy.Preferred)
      sizePolicy.setHorizontalStretch(1)
      sizePolicy.setVerticalStretch(1)
      sizePolicy.setHeightForWidth(self.centralwidget.sizePolicy().hasHeightForWidth())
      self.centralwidget.setSizePolicy(sizePolicy)
      self.centralwidget.setAutoFillBackground(True)
      self.centralwidget.setObjectName("centralwidget")
      self.verticalLayoutWidget = QtWidgets.QWidget(self.centralwidget)
      self.verticalLayoutWidget.setGeometry(QtCore.QRect(0, 0, 361, 671))
      self.verticalLayoutWidget.setObjectName("verticalLayoutWidget")
      self.verticalLayout = QtWidgets.QVBoxLayout(self.verticalLayoutWidget)
      self.verticalLayout.setSizeConstraint(QtWidgets.QLayout.SetMaximumSize)
      self.verticalLayout.setContentsMargins(2, 2, 2, 2)
      self.verticalLayout.setObjectName("verticalLayout")
      self.verticalLayout_2 = QtWidgets.QVBoxLayout()
      self.verticalLayout_2.setObjectName("verticalLayout_2")
      self.horizontalLayout = QtWidgets.QHBoxLayout()
      self.horizontalLayout.setObjectName("horizontalLayout")
      self.pshBtnSetInput = QtWidgets.QPushButton(self.verticalLayoutWidget)
      self.pshBtnSetInput.setObjectName("pshBtnSetInput")
      self.horizontalLayout.addWidget(self.pshBtnSetInput)
      self.lineEdit = QtWidgets.QLineEdit(self.verticalLayoutWidget)
      self.lineEdit.setObjectName("lineEdit")
      self.horizontalLayout.addWidget(self.lineEdit)
      self.verticalLayout_2.addLayout(self.horizontalLayout)
      self.horizontalLayout_2 = QtWidgets.QHBoxLayout()
      self.horizontalLayout_2.setObjectName("horizontalLayout_2")
      self.pshBtnSetOutput = QtWidgets.QPushButton(self.verticalLayoutWidget)
      self.pshBtnSetOutput.setObjectName("pshBtnSetOutput")
      self.horizontalLayout_2.addWidget(self.pshBtnSetOutput)
      self.lineEdit_2 = QtWidgets.QLineEdit(self.verticalLayoutWidget)
      self.lineEdit_2.setObjectName("lineEdit_2")
      self.horizontalLayout_2.addWidget(self.lineEdit_2)
      self.verticalLayout_2.addLayout(self.horizontalLayout_2)
      self.verticalLayout.addLayout(self.verticalLayout_2)
      self.horizontalLayout_3 = QtWidgets.QHBoxLayout()
      self.horizontalLayout_3.setObjectName("horizontalLayout_3")
      self.pshBtnAddAttributes = QtWidgets.QPushButton(self.verticalLayoutWidget)
      self.pshBtnAddAttributes.setObjectName("pshBtnAddAttributes")
      self.horizontalLayout_3.addWidget(self.pshBtnAddAttributes)
      self.pshBtnDelAttribute = QtWidgets.QPushButton(self.verticalLayoutWidget)
      self.pshBtnDelAttribute.setObjectName("pshBtnDelAttribute")
      self.horizontalLayout_3.addWidget(self.pshBtnDelAttribute)
      self.verticalLayout.addLayout(self.horizontalLayout_3)
      self.tableView = QtWidgets.QTableView(self.verticalLayoutWidget)
      self.tableView.setObjectName("tableView")
      self.verticalLayout.addWidget(self.tableView)
      self.pshBtnCut = QtWidgets.QPushButton(self.verticalLayoutWidget)
      self.pshBtnCut.setObjectName("pshBtnCut")
      self.verticalLayout.addWidget(self.pshBtnCut)
      MainWindow.setCentralWidget(self.centralwidget)
      self.actionOpen = QtWidgets.QAction(MainWindow)
      self.actionOpen.setObjectName("actionOpen")
  
      self.retranslateUi(MainWindow)
      QtCore.QMetaObject.connectSlotsByName(MainWindow)
  
  def retranslateUi(self, MainWindow):
      _translate = QtCore.QCoreApplication.translate
      MainWindow.setWindowTitle(_translate("MainWindow", "Нарезка тайлов"))
      self.pshBtnSetInput.setText(_translate("MainWindow", "Входящие"))
      self.pshBtnSetOutput.setText(_translate("MainWindow", "Исходящие"))
      self.pshBtnAddAttributes.setText(_translate("MainWindow", "Добавить атрибут"))
      self.pshBtnDelAttribute.setText(_translate("MainWindow", "Удалить атрибут"))
      self.pshBtnCut.setText(_translate("MainWindow", "Нарезать"))
      self.actionOpen.setText(_translate("MainWindow", "Open Folder"))
  </code></pre>
  
  <p>It all works fine in interpreter, it works fine when executed from .py or when i test from spyder. I frozed it with pyinstaller, and it works.
  But when i deploy it on any win7 x86 machines it stops working first time i call ui class.</p>
  
  <p>I traced error to call of any member of this class inside the constructor of MainWindow.</p>
  
  <pre><code>class MainForm(QtWidgets.QMainWindow):
  """
  Main Form of RasterCutterForm
  """
  def __init__(self, parent = None):
      try:
          QtWidgets.QWidget.__init__(self,parent)
          self.ui = Ui_MainWindow()
          self.ui.setupUi(self)
          self.DataModel = None
          self.DataModel = QtGui.QStandardItemModel(parent = self)
          self.DataModel.setHorizontalHeaderLabels(["Атрибут", "Значение"])
          print("self.tableView.setModel(self.DataModel)")
          self.ui.tableView.setModel(self.DataModel)
          print("Init Done.")
      except Exception as exc:
          print(exc)
  </code></pre>
  
  <p>Last print( " Set Model " ) is the last executed command.
  Any ideas?</p>