Reputation: 510
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
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
Reputation: 535
Seem pyinstaller run outside the virtualenv. Try switch to your virtualenv and run:
python -m PyInstaller -F file.py
Upvotes: 1
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
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