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.
Asked
Active
Viewed 9,930 times
1
-
Have you installed pyinstaller? – Erick Y. Carreno Dec 21 '20 at 21:00
-
Yes I have, with pip installer – mouse123 Dec 21 '20 at 21:03
-
What PATH did you add? was it like this `C:\Users\%USERNAME%\AppData\Roaming\Python\Python37\Scripts` – Erick Y. Carreno Dec 21 '20 at 21:08
-
No it was more like C:\Users\username\AppData\Local. I also check add python to path when installing. I even found the location of python on my computer and put that directory into path. I googled how to check if python is in path, and I'm pretty confident that I have python in my path. But if pyinstaller is in python, why is it still not working? – mouse123 Dec 21 '20 at 21:19
2 Answers
1
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:
- Click file at the top left corner
- Click settings
- Find your project on the toolbar on the left
- Click project interpreter
- To the right there will be a plus sign
- Click that and search pyinstaller
- Install
Good luck!

mouse123
- 65
- 1
- 7
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.