Search code examples
pythonpyinstaller

Multiple Hidden Imports in Pyinstaller


I know how to use the hidden import function in pyinstaller to import one python library. What if I have multiple python libraries like pyautogui and pandas? How do I hidden import them both? I’m thinking it looks something like this:

pyinstaller Pythonmain.py —hidden-import=‘pyautogui, pandas’

I’m sure it’s simple but I can’t find the answer anywhere.


Solution

  • You can repeat the --hidden-import option:

    pyinstaller main.py -—hidden-import pandas --hidden-import pyautogui
    

    From the documentation, emphasis mine:

    --hidden-import MODULENAME

    Name an import not visible in the code of the script(s). This option can be used multiple times.