15
votes

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?

11

11 Answers

19
votes

You have to modify your User PATH environment variable to include C:\Users\[USERNAME]\AppData\Local\Programs\Python\Python36-32\Scripts.

For how to add/modify your PATH environment variables, see this.

5
votes

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.

3
votes

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

0
votes

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.

0
votes

Enter in Administrative Console: pip install pyinstaller

0
votes

Had exactly the same issue:

  • Locate your Python folder and go to Python\Python38\Lib\site-packages
  • From there delete the Pyinstaller module and Pyinstaller dis.info folder
  • Reinstall Pyinstaller using pip install pyinstaller
0
votes

Goto - "C:\Users\Username\anaconda3\Scripts" path and copy "pyinstaller.exe" and paste it in the directory where you want to use pyinstaller, it worked for me

0
votes
  1. Open command cmd from this path: ctrl+r, write "cmd" in box
  2. Uninstall pyinstaller: pip uninstall pyinstaller
  3. Install it again: pip install pyinstaller
  4. Use the pyinstaller by writing pyinstaller
0
votes

I found How we should fix this error :

C:\Users\username>pyinstaller
'pyinstaller' is not recognized as an internal or external command,
operable program or batch file.

We should enter this code in cmd pip install pyinstaller if it is doesn't work again you should go C:/user/pc name/Appdata (Appdata folder is hide)/python now you should copy script folder and C:/program files/python39 and copy site package to C:/program files/python39/lib

then if you type pyinstaller in cmd you see it work

0
votes

I was getting the same error and fixed it.

Step-1: 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.

Step-2: Enter in Administrative Console: pip install pyinstaller

Then restart your PC and try running pyinsatller from anywhere it will work.

-1
votes

if you cannot do anything or you have less time, you can make the virtual environment and install pyinstaller there, then generate executable file