how to convert pyw to exe

I have installed pyinstaller like this pip install pyinstaller as a Youtube video said to convert pyw to exe. Then the tutorial said to convert pyw to exe you need to type pyinstaller -w filename.pyw , but this doesn't work for me why? enter image description here


pyinstaller is not a command on your system's PATH, which means that your terminal cannot find it. Because it is a Python module, you may be able to run it with python -m pyinstaller -w main.pyw. This -m <name> specifies that we wish to run a Python module with the given name.

Alternatively, you can add the location of the pyinstaller folder to your PATH. However, this requires finding out where pyinstaller was installed with pip, too. I've generally used the former strategy, and that's the strategy I recommend.