0

I have installed pyinstaller using pip3. In my home/pi folder, i have a python file (testProg.py) I tried to create the executable using pyinstaller.

pyinstaller --onefile testProg.py

But I am getting the following error

pyinstaller: command not found

Is it a directory problem? any help, please

pi@raspberrypi:~ $ pip3 install pyinstaller
Looking in indexes: https://pypi.org/simple, https://www.piwheels.org/simple
Requirement already satisfied: pyinstaller in ./.local/lib/python3.7/site-packages (3.6)
Requirement already satisfied: altgraph in ./.local/lib/python3.7/site-packages (from pyinstaller) (0.17)
Requirement already satisfied: setuptools in /usr/lib/python3/dist-packages (from pyinstaller) (40.8.0)

3

The folder where it was installed is probably not in your path.

It's easiest to install it in a virtual environment:

python3 -m venv pyinstaller-venv
source ./pyinstaller-venv/bin/activate
pip install pyinstaller
pyinstaller -v

You'll be able to use pyinstaller whenever you activate the virtual environment.


Alternatively, add the right folder to your path. It seems like you have installed Python in ~/.local, so make sure that ~/.local/bin is in your path:

export PATH="$HOME/.local/bin:$PATH"

You can make it permanent by adding the export ... command to your ~/.profile file.

If that's not the right path, you can search for pyinstaller using the find command:

find ~ -name pyinstaller -type f
  • I checked my .profile file. – sunny_old_days Apr 29 '20 at 7:27
  • 2
    @sunny_old_days please explain exactly what you did. I proposed three possible solutions. – tttapa Apr 29 '20 at 9:08
  • 1 I tried export PATH="$HOME/.local/bin:$PATH" and worked fine. But my program is a GUI application and there is a DateEntry Widget. Somehow it doesn't work after creating executable using pyinstaller. If I remove the DateEntry widget, everything works fine. – sunny_old_days Apr 29 '20 at 10:28
  • 1
    @sunny_old_days that sounds like a different problem. – tttapa Apr 29 '20 at 10:40

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.