Search code examples
pythonpyinstallerpraw

pyInstaller: ImportError: No module named 'praw'


I wanted to pack my script using pyInstaller. I run pyinstaller file.py -F, file is created successfully, but when running I get ImportError: No module named 'praw'. So I created new file containing only import praw and run pyinstaller file.py -F --hidden-import=praw but still get the same error when running.
I was unable to find anything similar, most issues were solved by using --hidden-import.
Any ideas on how it can be solved?
EDIT:
praw is installed inside virtual environment and running the script directly works as expected.


Solution

  • Seem pyinstaller run outside the virtualenv. Try switch to your virtualenv and run:

    python -m PyInstaller -F file.py