I am trying to use pyinstaller
in cmd but I receive error:
C:\Users\username>pyinstaller
'pyinstaller' is not recognized as an internal or external command,
operable program or batch file.
C:\Users\username>
When I use this command in the Scripts folder in python , it works:
C:\Users\username\AppData\Local\Programs\Python\Python36-32\Scripts>pyinstaller
usage: pyinstaller [-h] [-v] [-D] [-F] [--specpath DIR] [-n NAME]
[--add-data <SRC;DEST or SRC:DEST>]
[--add-binary <SRC;DEST or SRC:DEST>] [-p DIR]
[--hidden-import MODULENAME]
[--additional-hooks-dir HOOKSPATH]
[--runtime-hook RUNTIME_HOOKS] [--exclude-module EXCLUDES]
[--key KEY] [-d] [-s] [--noupx] [-c] [-w]
[-i <FILE.ico or FILE.exe,ID or FILE.icns>]
[--version-file FILE] [-m <FILE or XML>] [-r RESOURCE]
[--uac-admin] [--uac-uiaccess] [--win-private-assemblies]
[--win-no-prefer-redirects]
[--osx-bundle-identifier BUNDLE_IDENTIFIER]
[--distpath DIR] [--workpath WORKPATH] [-y]
[--upx-dir UPX_DIR] [-a] [--clean] [--log-level LEVEL]
[--upx UPX]
scriptname [scriptname ...]
pyinstaller: error: the following arguments are required: scriptname
C:\Users\username\AppData\Local\Programs\Python\Python36-32\Scripts>
How to solve this?
For Python 3.7, you will have to add the Scripts folder from AppData/Roaming (%appdata%) to the PATH variable.
C:\Users\%USERNAME%\AppData\Roaming\Python\Python37\Scripts
if you cannot do anything or you have less time, you can make the virtual environment and install pyinstaller there, then generate executable file
you have to modify your PATH environ to include
C:\Users\username\AppData\Local\Programs\Python\Python36-32\Scripts>
if you don't know how to do it look heregood luck
Copy youe script folder's path
C:\Users\username\AppData\Local\Programs\Python\Python36-32\Scripts
and paste it in:environment varibales> system varibales> path
and save it. Then restart your PC and try running pyinsatller from anywhere it will work.Copy 'pyinstaller.exe' to the folder you have the .py file you want to convert. When you are done, just delete 'pyinstaller.exe'. Good luck.