title: Pyinstaller/CXFreeze bundle keeps rerunning the project on an infinite loop on mac
body: <p>I ran <code>pyinstaller --windowed --onedir Yuro.py</code> and through troubleshooting I realized that my ipython console causes this infinite loop and I do not know how to stop it. When I click the finished pyinstaller bundle the project keeps rerunning on an infinite loop.</p>
  <p>This is my app window starter code:</p>
  <pre><code>if __name__ == '__main__':
      app = QApplication(sys.argv)
      app.setWindowIcon(QIcon('images/icons8-lion-96.png'))
      app.setApplicationName(&quot;YuroPy IDE&quot;)
      window = Window()
      screen = app.primaryScreen()
      size = screen.size()
      window.resize(round(size.width() - size.width()/20), round(size.height() - size.height()/7))
      qr = window.frameGeometry()
      cp = QDesktopWidget().availableGeometry().center()
      qr.moveCenter(cp)
      window.move(qr.topLeft())
      window.show()
      sys.exit(app.exec())
  </code></pre>
  <p>and this is my ipython qtconsole code:</p>
  <pre><code>USE_KERNEL = 'python3'
  
  def make_jupyter_widget_with_kernel():
      &quot;&quot;&quot;Start a kernel, connect to it, and create a RichJupyterWidget to use it
      &quot;&quot;&quot;
      kernel_manager = QtKernelManager(kernel_name=USE_KERNEL)
      kernel_manager.start_kernel()
  
      kernel_client = kernel_manager.client()
      kernel_client.start_channels()
  
      jupyter_widget = RichJupyterWidget()
      jupyter_widget.kernel_manager = kernel_manager
      jupyter_widget.kernel_client = kernel_client
      return jupyter_widget
  </code></pre>
  <p>I also tried using CXFreeze, I didn't receive any error but the bundle kept running infinitely. Is this normal? and if its not how do I cope with it. I also added <code>multiprocess.freeze_support()</code> but it didn't help! These are all my imports:</p>
  <pre><code>from PyQt5.QtWidgets import QApplication, QTextEdit, QWidget, QPlainTextEdit, QTabBar, QPushButton, QMainWindow, QMenuBar, QAction, QVBoxLayout, QToolBar, QToolButton, QMenu, QLineEdit, QTreeView, QFileSystemModel, QTabWidget, QTreeWidget, QTreeWidgetItem, QStyle, QAbstractItemView, QHBoxLayout, QSplitter, QLabel, QDesktopWidget, QStylePainter, QStyleOptionButton, QInputDialog, QFileDialog, QMessageBox
  from PyQt5.QtWebEngineWidgets import QWebEngineView
  from PyQt5.QtGui import QKeySequence, QFont, QIcon, QFontMetrics, QTextCursor, QPainter, QColor, QImage
  from PyQt5.QtCore import pyqtSlot, QRect, pyqtSignal, QDir, Qt, QUrl, QSocketNotifier, QSize
  from PyQt5 import QtSvg
  from PyQt5.Qsci import QsciScintilla, QsciLexerPython, QsciLexerCSS, QsciLexerHTML, QsciLexerJavaScript, QsciLexerCustom, QsciAPIs
  import PyQt5
  from qtconsole.rich_jupyter_widget import RichJupyterWidget
  from qtconsole.manager import QtKernelManager
  from pathlib import Path
  from pylint import lint
  from pylint.reporters.text import TextReporter
  import os
  import re
  #os.environ['QT_API'] = 'pyqt5'
  import subprocess
  import sys
  import shutil
  import pickle
  import threading
  import webbrowser
  import locale, pty, struct, termios
  </code></pre>