Szymon
Szymon

Reputation: 510

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.

Upvotes: 0

Views: 1269

Answers (4)

Jeff Hu
Jeff Hu

Reputation: 744

I found a way to solve the issue:

When using Python2.7, or starting the shell like python2, we need to do

python2 -m pip install --user praw

to make sure they are linked during installation.

Same idea for python3 shell.

Upvotes: 0

MartinP
MartinP

Reputation: 535

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

python -m PyInstaller -F file.py

Upvotes: 1

Steve Woods
Steve Woods

Reputation: 227

This command might help you out. It installs the Praw module for you. Make sure you have pip installed!

pip install praw

Upvotes: 0

F. den Boeren
F. den Boeren

Reputation: 1

I'll recommend to look at pyenv or virtualenv. Activate these env's and install the praw module here. This should work.

Upvotes: 0

Related Questions