Install pip using pip install pyinstaller in the directory of the source code file run pyinstaller <file_name>.py
.\pyinstaller --onefile -w 'filename.py'
pyinstaller --onefile -w 'filename.py'