How do I fix PyInstaller is not recognized?

add the python scripts folder to your PATH. to do this you need to note the directory of the scripts folder. this is my directory C:\Python39\Scripts\ but yours can vary. just check if it is the same. after that follow these instructions:

In Search, search for and then select: System (Control Panel)

Click the Advanced system settings link.

Click Environment Variables. In the section System Variables find the PATH environment variable and select it. Click Edit. If the PATH environment variable does not exist, click New.

In the Edit System Variable (or New System Variable) window, copy the name of the directory. Click OK. Close all remaining windows by clicking OK.

Also see if u are running cmd as admin

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?


1) Solution

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.

2) Solution

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

3) Solution

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.

4) Solution

I did correctly configured my script path, I had to run python -m PyInstaller script.py in order for it to work

For every script I have to follow this pattern, python -m [scriptname] [args]

python version 3.10.0

5) Solution

First, you need to know where is the pyinstaller locates. In my case, I ran

pip uninstall pyinstaller

Before it's being uninstalled, it will ask you to confirm if you want to remove the following file...

c:\users\USERNAME\appdata\local\packages\pythonsoftwarefoundation.python.3.9_qbz5n2kfra8p0\localcache\local-packages\python39\scripts\pyinstaller.exe

Great! Now by doing this, you know your path to pyinstaller. Simple type 'No' and exit the uninstallation as our purpose is just to get the path. Now just add this path to the PATH variable.

c:\users\USERNAME\appdata\local\packages\pythonsoftwarefoundation.python.3.9_qbz5n2kfra8p0\localcache\local-packages\python39\scripts\

For how to change your PATH variable. Check here

6) Solution

This solution work for Python 3.9

First of all find the pyinstaller.exe location. To do this you could try this trick: (do not press 'y' just look at the above copy the path what you are looking for)

pip uninstall pyinstaller

Before typing anything, it will show you the path where the pyinstaller.exe is. After that copy the location and run this command on terminal: (it is an example)

python C:\Users\[YOUR_USER_NAME]\AppData\...Scripts\pyinstaller.exe --onefile [your_script_name.py]

7) Solution

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

8) Solution

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.

9) Solution

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

10) Solution

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

11) Solution

  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

12) Solution

Oddly, for me changing the capitalization resolved the issue. I typed python -m [scriptname] [args]. In [scriptname] I typed PyInstaller instead of pyinstaller and it actually worked. I tried both ways multiple times.

13) Solution

  1. Open PowerShell as adm
  2. Uninstall pyinstaller by running pip uninstall pyinstaller
  3. Type y to confirm the uninstall
  4. Reinstall using py -m pip install pyinstaller

14) Solution

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

15) Solution

Enter in Administrative Console: pip install pyinstaller

16) Solution

If installing pyinstaller and creating the 'path' variables still does not work, u can use this workaround:

Locate pyinstaller.exe from possible python directory like C:\Users\ "UserName" \AppData\Local\Packages\PythonSoftwareFoundation.Python.3.10_qbz5n2kfra8p0\LocalCache\local-packages\Python310\Scripts

Copy it to the dir that you have the .py file you want to compile as .exe

Use following command in terminal: .\pyinstaller --onefile YOUR_FILE_NAME.py

17) Solution

First, you should check the configuration, ports, and active process.

After checking these processes, you can check the local folder.

You will find the pyinstaller inside this folder; there will be a pyinstaller.exe file.

Then set the path

C:\Users\[username]\AppData\Local\Programs\Python\Python39\Scripts,

C:\Users\[username]\AppData\Local\Programs\Python\Python39.

After that, you can run the command pyinstaller --onefile -w filename.py

18) Solution

If you don't have pip in the PATH of your cmd, then you can run these commands in cmd for windows.

  1. python -m pip install pyinstaller - for installing pyinstaller.
  2. python -m pip uninstall pyinstaller - for uninstalling pyinstaller.

Related Topics python pyinstallerComments12 months agoanaconda3 is not found Mentions user8533214 Justin user10089632 Manan Elijah David Twister Joe PJ3 pratham82 Jesse Nizorrro Manoj Buddha Dan R AT160 Roshin Raphel Amir BoyAcc Niraj Panchasara Irick Barfield Bakalis Alexandros iamzeid karishma tejwani Tomerikoo Reuber Parreira wp78de Pawan Prajapati Rishabh Aher

Why is PyInstaller not working?

The most common reason a PyInstaller package fails is that PyInstaller failed to bundle a required file. Such missing files fall into a few categories: Hidden or missing imports: Sometimes PyInstaller can't detect the import of a package or library, typically because it is imported dynamically.

Where is PyInstaller exe located?

After installation, the pyinstaller binary is located in your virtual environment's bin/ directory, or where your Python executable is located. If that directory isn't in your PATH , include the whole path when you run pyinstaller .

How do I add PyInstaller to path?

type pip install pyinstaller ..
Click file at the top left corner..
Click settings..
Find your project on the toolbar on the left..
Click project interpreter..
To the right there will be a plus sign..
Click that and search pyinstaller..
Install..

How do I install PyInstaller on Windows 10?

To install PyInstaller: Go to your command prompt (Start -> Run -> cmd) type the following command cd c:\python27\scripts press enter, this should be where your pip.exe file is located. Once you are in this directory type pip install pyinstaller press enter.