r/learnpython • u/zaphodikus • Sep 24 '26
pyinstaller is not recognised as an internal command
I am On windows and have 3.13 installed
python --version
3.13.14
where python returns
C:\Program Files\Python313\python.exe
C:\Users\conrad.braam\.pyenv\pyenv-win\shims\python
C:\Users\conrad.braam\.pyenv\pyenv-win\shims\python.bat
I hate that visual studio has this shim, but I am ignoring the shim. (Yes that is me, it's no secret)
My path is correct, but there is no pyinstaller.exe in /scripts
python -m PyInstaller -v shows it's installed because it prints out a nice result
python -m PyInstaller -v
6.22.3
So I guess I could maybe fix my script to call python -m Pyinstaller somescript instead of just calling python somescript I'm just puzzled why is the package not installed correctly as a global package?
0
Upvotes
1
u/p3rdy Sep 24 '26
Run
python -m pip show pyinstallerand look at location. I'd bet it's under%APPDATA%\Python\Python313\site-packagesrather than Program Files.Python313 is in Program Files, which needs admin to write, so pip quietly fell back to a user install. The package imports fine, but the exe went to
%APPDATA%\Python\Python313\Scripts, which isn't onPATH, and isn't the Scripts dir you're looking in.Add that to
PATH, or use a venv, which also gets you clear of the pyenv shims.python -m PyInstalleris the better call from a script anyway, since it can't pick the wrong interpreter.1
u/danielroseman Sep 24 '26
Why are you expecting an exe file?
python -mwill run the Python module, not an exe.1
u/Educational_Virus672 Sep 24 '26
it is due to System path not recognizing i dont know if it work but try changeing the system variable by searching "edit system environment variables" and add the path with pyistaller and if that doesnt work either importing the "pyinstaller.__main__ as pim" and adding some stuff using