Matt
Matt

Reputation: 11

pyinstaller creating empty dist folder/ no EXE

I am trying to create a exe for some python script.

The script runs perfectly but I cannot seem to create an exe. I have tried pyinstaller and py2exe but neither seem to work.

pyinstaller runs fine then creates an empty dist folder (no exe) on 3.8 (I am guessing this is due to compatibility issues).

When I run pyinstaller on 3.7 is states; 'pyinstaller' is not recognized as an internal or external command, operable program or batch file.

When I try py2exe on either 3.7 or 3.8 it fails and states; IdexError: tuple index out of range.

Is there a particular version of python I should use for pyinstaller? (3.7.4 ok?)

Also, is there any way of removing all python files and files associated with python through cmd to start fresh? (I am concerned I may not be running solely on one version of python which could cause the error?)

My code:

print("hello world")

I just need an exe file.

Any help would be very much appreciated!!

Thank you!

Upvotes: 0

Views: 2453

Answers (1)

Matt
Matt

Reputation: 11

I managed to create an exe using PyInstaller. There were two issues:

  • PyInstaller is not compatible with python 3.8, this is why dist was empty.
  • When I installed python 3.7, the path was not pointing to python37\scripts.

Resolution:

  • Uninstalled python, Deleted any related python files by searching 'python' in file explorer.
  • Downloaded python 3.7.4 web-based installer and clicked CREATE PATH on the setup wizard.
  • re-installed pyinstaller.

NOTE: I did try to manually update the environment variables, but when I changed the scripts path to python37, cmd was still throwing a path error.

Upvotes: 1

Related Questions