Skip to content Skip to sidebar Skip to footer

Pyinstaller Command Not Found (MacOS)

I've been trying to use PyInstaller on my program, scratch_1.py. The PyCharm project folder is called 'idigen', which is saved in my desktop. So, I changed the director like so: cd

Solution 1:

This is a common problem due to the fact that you might install a different version of python and keep using an old version that is preinstalled in the machine. Here is the best solution.

First, check the version of the python that you installed. In my case, i installed python 3.5 and the machine had python2.7. If you run python on the terminal, most likely the preinstalled one is the one that will run.

Second, check the directory of your desired python version. watch -a python3 is the command to run to see your directory.

Third, set the directory as the main one to run your python commands. alias python=/usr/local/bin/python3 does the whole trick

Lastly, reinstall pip. Download the get-pip.py file and run sudo /usr/local/bin/python3 get-pip.py * I used the path to show the reason we updated the alias*

Now you can run pyinstaller without problems


Solution 2:

pyinstaller appears to have installed correctly, but the command is not available on PATH. You need to locate where the executable was placed.`below to find executables

set | grep pyinstaller

now modify path by this

 export PATH=some_path:another_path
launchctl setenv PATH $PATH

Solution 3:

I just downloaded the source code of pyInstaller from official website, put it where I can find it and wrote a script which launches pyinstaller.py from that folder. For some reason, pyinstaller.py is missing in the pyInstaller installation downloaded via pip.


Solution 4:

I had the same issue on MacOS with Developer Tools 11.4 and found two ways to start pyinstaller:

alt 1: path based solution

$ pip3 show -f pyinstaller|grep pyinstaller

will find pyinstaller in a bin path:

../../../../usr/local/bin/pyinstaller
...

So you can use one of the set-the-path-or-an-alias approaches or call via fully qualified path.

alt 2: call via python module

$ pip3 show -f pyinstaller|grep __init__

will get you a hint on how pyinstaller is defined as a module:

PyInstaller/__init__.py
...

With that capitalization, it's possible to call pyinstaller as a module with the following:

$ python3 -m PyInstaller --version      
4.2

I'm using the latter now.


Post a Comment for "Pyinstaller Command Not Found (MacOS)"