How can I make a Python script standalone executable to run without ANY dependency?

后端 未结 19 2708
眼角桃花
眼角桃花 2020-11-21 04:51

I\'m building a Python application and don\'t want to force my clients to install Python and modules.

So, is there a way to compile a Python script to be a standalone

19条回答
  •  情深已故
    2020-11-21 05:25

    You can use PyInstaller to package Python programs as standalone executables. It works on Windows, Linux, and Mac.

    PyInstaller Quickstart

    Install PyInstaller from PyPI:

    pip install pyinstaller
    

    Go to your program’s directory and run:

    pyinstaller yourprogram.py
    

    This will generate the bundle in a subdirectory called dist.

    For a more detailed walkthrough, see the manual.

提交回复
热议问题