'How do I add pyinstaller to PATH?

I have a pygame project stored in C:\Users\name\GameProject. I followed instructions to create an exe by typing in pyinstaller --onfile -w game.py. However, every time it tells me that pyinstaller is not recognized as an internal or external command. I googled some answers, and apparently python is not in my path. The problem is, I've added everything I could to both the user path and system path. I even reinstalled python, checking add to path. Pyinstaller still is unable to make me an exe file. Can I have some insight on why this might be? I'm on windows 10, using python 3.9.



Solution 1:[1]

I know that this might seem odd but try this:

  • try uninstalling python, then reinstalling it "make sure you press add to PATH".

  • when you do install it again, restart your device and open the command prompt.

  • type pip install pyinstaller.

I encountered the same issue and when I did this it worked perfectly. it's definitely an environmental variable issue.

Solution 2:[2]

To everyone that has the same problem as me, if you are using PyCharm, make sure to install pyinstaller on the project interpreter as well! It worked for me.

If you don't know how:

  1. Click file at the top left corner
  2. Click settings
  3. Find your project on the toolbar on the left
  4. Click project interpreter
  5. To the right there will be a plus sign
  6. Click that and search pyinstaller
  7. Install

Good luck!

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 Mohammad El Arabi El Azzouzi
Solution 2 mouse123