title: How to compile PyQt5 program that uses python 3.8
body: <p>I am trying to compile a simple PyQt5 program into a single EXE file. I have been trying to use <code>fbs</code> for this but I have had no luck. Is there another easy way to do what I am trying to do?</p>
  <p>And if the suggestion is to use pyinstaller please explain to me how exactly to do it. I don't do well with vague instructions like &quot;Just use pyinstaller&quot; and they have a link to the wiki. that is not helpful to me because I have already gone there and did not understand it.</p>
  <p>Any help is greatly appreciated.</p>
  <p>If it helps here is my main.py file:</p>
  <pre><code># -*- coding: utf-8 -*-
  
  # Form implementation generated from reading ui file 'MainMenu.ui'
  #
  # Created by: PyQt5 UI code generator 5.13.2
  #
  # WARNING! All changes made in this file will be lost!
  
  
  from PyQt5 import QtCore, QtGui, QtWidgets
  
  
  class Ui_MainWindow(object):
      def setupUi(self, MainWindow):
          MainWindow.setObjectName(&quot;MainWindow&quot;)
          MainWindow.resize(422, 350)
          self.centralwidget = QtWidgets.QWidget(MainWindow)
          self.centralwidget.setObjectName(&quot;centralwidget&quot;)
          self.mmlbl = QtWidgets.QLabel(self.centralwidget)
          self.mmlbl.setGeometry(QtCore.QRect(30, 20, 131, 41))
          font = QtGui.QFont()
          font.setPointSize(24)
          font.setItalic(False)
          self.mmlbl.setFont(font)
          self.mmlbl.setObjectName(&quot;mmlbl&quot;)
          self.Updates_button = QtWidgets.QPushButton(self.centralwidget)
          self.Updates_button.setGeometry(QtCore.QRect(20, 70, 181, 31))
          self.Updates_button.setAcceptDrops(False)
          self.Updates_button.setObjectName(&quot;Updates_button&quot;)
          self.fwlbutton = QtWidgets.QPushButton(self.centralwidget)
          self.fwlbutton.setGeometry(QtCore.QRect(20, 110, 181, 31))
          self.fwlbutton.setObjectName(&quot;fwlbutton&quot;)
          self.rmvprosoftbutton = QtWidgets.QPushButton(self.centralwidget)
          self.rmvprosoftbutton.setGeometry(QtCore.QRect(20, 150, 181, 31))
          self.rmvprosoftbutton.setObjectName(&quot;rmvprosoftbutton&quot;)
          self.auditbutton = QtWidgets.QPushButton(self.centralwidget)
          self.auditbutton.setGeometry(QtCore.QRect(20, 190, 181, 31))
          self.auditbutton.setObjectName(&quot;auditbutton&quot;)
          self.basicConfbutton = QtWidgets.QPushButton(self.centralwidget)
          self.basicConfbutton.setGeometry(QtCore.QRect(220, 190, 181, 31))
          self.basicConfbutton.setObjectName(&quot;basicConfbutton&quot;)
          self.UserGroupsButton = QtWidgets.QPushButton(self.centralwidget)
          self.UserGroupsButton.setGeometry(QtCore.QRect(220, 70, 181, 31))
          self.UserGroupsButton.setObjectName(&quot;UserGroupsButton&quot;)
          self.malrembutton = QtWidgets.QPushButton(self.centralwidget)
          self.malrembutton.setGeometry(QtCore.QRect(220, 150, 181, 31))
          self.malrembutton.setObjectName(&quot;malrembutton&quot;)
          self.servsetbutton = QtWidgets.QPushButton(self.centralwidget)
          self.servsetbutton.setGeometry(QtCore.QRect(220, 110, 181, 31))
          self.servsetbutton.setObjectName(&quot;servsetbutton&quot;)
          self.srchmedbutton = QtWidgets.QPushButton(self.centralwidget)
          self.srchmedbutton.setGeometry(QtCore.QRect(20, 230, 181, 31))
          self.srchmedbutton.setObjectName(&quot;srchmedbutton&quot;)
          self.quit_button = QtWidgets.QPushButton(self.centralwidget)
          self.quit_button.setGeometry(QtCore.QRect(300, 260, 81, 41))
          self.quit_button.setObjectName(&quot;quit_button&quot;)
          MainWindow.setCentralWidget(self.centralwidget)
          self.menubar = QtWidgets.QMenuBar(MainWindow)
          self.menubar.setGeometry(QtCore.QRect(0, 0, 422, 18))
          self.menubar.setObjectName(&quot;menubar&quot;)
          self.menuAbout = QtWidgets.QMenu(self.menubar)
          self.menuAbout.setObjectName(&quot;menuAbout&quot;)
          MainWindow.setMenuBar(self.menubar)
          self.statusbar = QtWidgets.QStatusBar(MainWindow)
          self.statusbar.setObjectName(&quot;statusbar&quot;)
          MainWindow.setStatusBar(self.statusbar)
          self.actionAbout_Creator = QtWidgets.QAction(MainWindow)
          self.actionAbout_Creator.setObjectName(&quot;actionAbout_Creator&quot;)
          self.actionHow_To_Use = QtWidgets.QAction(MainWindow)
          self.actionHow_To_Use.setObjectName(&quot;actionHow_To_Use&quot;)
          self.menuAbout.addAction(self.actionAbout_Creator)
          self.menuAbout.addAction(self.actionHow_To_Use)
          self.menubar.addAction(self.menuAbout.menuAction())
  
          self.retranslateUi(MainWindow)
          QtCore.QMetaObject.connectSlotsByName(MainWindow)
  
      def retranslateUi(self, MainWindow):
          _translate = QtCore.QCoreApplication.translate
          MainWindow.setWindowTitle(_translate(&quot;MainWindow&quot;, &quot;Apple CIDR Script Runner&quot;))
          self.mmlbl.setText(_translate(&quot;MainWindow&quot;, &quot;Main Menu&quot;))
          self.Updates_button.setText(_translate(&quot;MainWindow&quot;, &quot;Updates&quot;))
          self.fwlbutton.setText(_translate(&quot;MainWindow&quot;, &quot;Firewall Settings&quot;))
          self.rmvprosoftbutton.setText(_translate(&quot;MainWindow&quot;, &quot;Remove Prohibited Software&quot;))
          self.auditbutton.setText(_translate(&quot;MainWindow&quot;, &quot;Audit System&quot;))
          self.basicConfbutton.setText(_translate(&quot;MainWindow&quot;, &quot;Basic Configurations&quot;))
          self.UserGroupsButton.setText(_translate(&quot;MainWindow&quot;, &quot;User / Group Settings&quot;))
          self.malrembutton.setText(_translate(&quot;MainWindow&quot;, &quot;Malware Removal&quot;))
          self.servsetbutton.setText(_translate(&quot;MainWindow&quot;, &quot;Services Settings&quot;))
          self.srchmedbutton.setText(_translate(&quot;MainWindow&quot;, &quot;Search For Prohibited Media&quot;))
          self.quit_button.setText(_translate(&quot;MainWindow&quot;, &quot;Quit&quot;))
          self.menuAbout.setTitle(_translate(&quot;MainWindow&quot;, &quot;Help&quot;))
          self.actionAbout_Creator.setText(_translate(&quot;MainWindow&quot;, &quot;About Creator&quot;))
          self.actionHow_To_Use.setText(_translate(&quot;MainWindow&quot;, &quot;How To Use&quot;))
  
  
  if __name__ == &quot;__main__&quot;:
      import sys
      app = QtWidgets.QApplication(sys.argv)
      MainWindow = QtWidgets.QMainWindow()
      ui = Ui_MainWindow()
      ui.setupUi(MainWindow)
      MainWindow.show()
      sys.exit(app.exec_())
  </code></pre>
  <h3>Edit: 8/19/2020</h3>
  <p>I have been able to successfully compile my python program into an <code>EXE</code> file using a program called <code>auto-py-to-exe</code> <a href="https://pypi.org/project/auto-py-to-exe/" rel="nofollow noreferrer">https://pypi.org/project/auto-py-to-exe/</a>. This program uses pyinstaller and creates a GUI pyinstaller configuration page in your browser. (This makes setting up your pyinstaller command much easier)</p>
  <p>Here is what it looks like when running: <a href="https://i.stack.imgur.com/PlJbU.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/PlJbU.png" alt="enter image description here" /></a></p>
  <p>All you will have to do is fill in your information and hit <code>Convert .PY to .EXE</code></p>
  <p>Also, I recommend that you set the output location of the compiled .exe so you can find it easily.</p>
  <p>One more thing. Make sure that when you are doing this, the project that you are working on is on the same hard drive that python is installed on. For example, if you have python installed on your C: drive on windows and your python project is on an external hard drive, it will not work. Move your project over to the Desktop or some where on the C: drive.</p>
  <p>Hope that made sense, good luck!</p>