0

I need to create an executable file from multiple python files and I chose to go with pyinstaller. I installed it with pip install pyinstaller. But when I executed the command of pyinstaller --onefile Main.py, I got the following error:

'pyinstaller' is not recognized as an internal or external command,
operable program or batch file.

I checked this page for the solution to this problem and tried out the following options but none of them could solve the issue:

  1. Added python scripts folder to env path.
  2. Uninstalled and reinstalled pyinstaller
  3. Copied pyinstaller.exe and pyinstaller-script.py to project directory.

The third option did give some progress but I still couldn't get it to work. I copied the pyinstaller.exe and pyinstaller-script.py to the location of my python files location. Running the pyinstaller command again gave me the following error:

Unable to create process using 'D:\Projects\FSS\python.exe "D:\Projects\FSS\FSS Mini PC Application\pyinstaller-script.py" --onefile -w Main.py'

My user environment variables are as follows:

enter image description here

My system environment variables are as follows: enter image description here

I am stuck on this problem and would appreciate some help.

Mobi Zaman
  • 605
  • 1
  • 6
  • 19

1 Answers1

0

I had the same problem so I used

py -m pip install pyinstaller

and it worked .

vimuth
  • 5,064
  • 33
  • 79
  • 116