Search code examples
pyinstallerpython-3.10pygui

Does Pyinstaller also bundles Python3?


I am trying to create a package of my Python3 script using Pyinstaller. I have one query: will the bundled file in the dist folder include python3 as well?

Will that executable work on a system that does not have python3 installed?

I am using the following command to create a single executable file:

pyinstaller --onefile <python3_Script>.py

Following are the packages I am using in my script:

  • import PyPDF4
  • import requests
  • import PySimpleGUI as sg
  • import re
  • import pandas as pd

Solution

  • I suggest reading the PyInstaller Manual which states

    PyInstaller bundles a Python application and all its dependencies into a single package. The user can run the packaged app without installing a Python interpreter or any modules.

    You may also be interested in What PyInstaller Does and How It Does It where you can find your answer

    You distribute the bundle as a folder or file to other people, and they can execute your program. To your users, the app is self-contained. They do not need to install any particular version of Python or any modules. They do not need to have Python installed at all.

    Also, keep in mind that

    The output of PyInstaller is specific to the active operating system and the active version of Python.