I was trying to convert my main.py
to a exe file
I followed a tutorial on youtube i did it like it said
then type in pip install pyinstaller
then type in like this
pyinstaller --onefile main.py
but it does'nt convert it shows this
I was trying to convert my main.py
to a exe file
I followed a tutorial on youtube i did it like it said
then type in pip install pyinstaller
then type in like this
pyinstaller --onefile main.py
but it does'nt convert it shows this
This issue is probably caused because pyinstaller
is not in the PATH environment variable.
First, find the full path of pyinstaller.exe - it should be in the Scripts directory of your Python installation (probably C:\Users\[USERNAME]\AppData\Local\Programs\Python\[Python_VER]\Scripts
). Copy the full path.
Then open a command prompt (as Administrator) and run the command:
setx PATH "%PATH%;PYINSTALLER_PATH"
where PYINSTALLER_PATH is the full path of pyinstaller you have copied.
Then re-launch command prompt and run the command again.
While Eyal's solution is correct, there is an easier option. Just run this:
py -m PyInstaller --onefile main.py
It could also be python -m PyInstaller --onefile main.py
depending on your system configuration.