I\'ve begun using Pyinstaller over Py2Exe. However I\'ve rather quickly run into a problem. How do I exclude modules that I don\'t want, and how do I view the ones that are
I've seen a lot of questions like this, but no one teaches you how to debug by yourself.
document of pyinstaller may have useful for beginner, but once you need more ...
personally, think the pyinstaller documentation is not friendly (Too few examples) and lacks updates.
for example, The document shows the version of the pyinstaller is 3.2. (3.5 is available now (2019/10/5))
I want to say that you should find the answer from source code
# run_pyinstaller.py
from PyInstaller.__main__ import run
run()
before you run this script you can assign parameters, like "--clean your.spec"
set breakpoint at {env_path}/Lib/site-packages/PyInstaller/building/build_main.py -> def build(...) ... -> exec(code, spec_namespace) like below:
note: If you are not using the virtual environment, the actual path should be {Python}/Lib/site-packages/PyInstaller/building/build_main.py
then you can watch any variables that you interested in.
also, you will learn more about pyinstaller.exe actually do what.
for example, you learn the class of TOC is inherits to list, and see more the detail than the document from PyInstaller.building.datastruct
eventually, you can use any python way to set a.binaries and a.datas that is you really wanted
from PyInstaller.building.datastruct import TOC, Tree
from PyInstaller.building.build_main import Analysis
from PyInstaller.building.api import EXE, PYZ, COLLECT, PKG, MERGE