CartClash
CartClash

Reputation: 55

Getting "unrecognized arguments" error when trying to exclude modules in PyInstaller

I'm trying to run pyinstaller inside of a python program. Everything works except for when I try to use the --exclude-module PIL parameter, I get the following error: pyinstaller: error: unrecognized arguments: --exclude-module PIL

Here's my exact code:

import PyInstaller.__main__

PyInstaller.__main__.run([
    'res/output/output.py',
    '--onedir',
    '--exclude-module PIL',
    "--noconsole"
])

Upvotes: 1

Views: 1382

Answers (1)

Alexander
Alexander

Reputation: 17365

You need to split up the flags and its argument.

For Example:

PyInstaller.__main__.run([
    'res/output/output.py',
    '--onedir',
    '--exclude-module', 
    'PIL',
    '--noconsole'
])

Upvotes: 4

Related Questions