Skip to content Skip to sidebar Skip to footer

How To Compile Pyqt5 Program That Uses Python 3.8

I am trying to compile a simple PyQt5 program into a single EXE file. I have been trying to use fbs for this but I have had no luck. Is there another easy way to do what I am tryin

Solution 1:

Unless you absolutely require python 3.8, you can use still use fbs to build your app.

fbs works with python up to 3.6.x, so the most straight forward & quickest way to get it going is to use a virtual environment.

This is currently my workflow to build & distribute fbs/PyQt5/python36 apps for macOS and win10. I also recommend including all dependencies in your fbs project's ./requirements/base.txt for better/built-in project portability & documentation via. pip install -r ./requirements/base.txt.

Steps

  1. Install python 3.6.x
  2. Install virtual environment of your choice
    • pip install virtualenv
  3. Create & start virtual environment with specific python version
    • virtualenv -p C:/Python36/python.exe venv
    • start ./venv/Scripts/activate.bat (you may have to run this in cmd.exe)
    • Your cmd prompt should now look different (ie. (venv) C:\Users>)
  4. Run fbs app again to make sure no compiler issues with python 3.6.x
    • fbs run
    • Fix any new compiler/syntax issues
  5. If all goes well, attempt to freeze the app again
    • fbs freeze

Post a Comment for "How To Compile Pyqt5 Program That Uses Python 3.8"