-1

Recently I have written a simple software in python and now I would like to share it with some people, but the problem is that they don't use python on their computer. Because of that an executable program could help me a lot and I tried to do it by using the package Pyinstaller with the following syntax:

pyinstaller --onefile -w program.py

After doing that three new folders was created and I found the executable file inside the dist folder but it doesn't work. When I clicked twice a error message showed up

Error message

Could anyone please tell why it happens and how I can work around this situation ? And also if you have another idea about how to convert .py to .exe besides using the Pyinstaller it would help me so much as well. I'm using python 3.8

Thanks

blockout
  • 11
  • 2
  • Does this answer your question? [Windows- Pyinstaller Error "failed to execute script " When App Clicked](https://stackoverflow.com/questions/40716346/windows-pyinstaller-error-failed-to-execute-script-when-app-clicked) – Martheen Apr 10 '20 at 23:48

2 Answers2

0

PyInstaller does not compile Python code into binary code. It just bundles your code into one installable exe file. So it does not improve the performance or code privacy.

Better option is to use CXFreeze or Nuitka. I personally prefer to use Nuitka because it worked in most cases where CXFreeze could not deal with.

Simply install Nuitka using pip or conda command. The documentation itself is quite good to start with.

DumTux
  • 668
  • 1
  • 9
  • 24
  • Nice! this was a case that both(CXFreeze and Nuitka) options worked. To convert by using CXFreeze I needed to use a simple code also in python but it was just a detail. Again thank you for the tip – blockout Apr 12 '20 at 00:41
0

What error does it give you?

I haven't used Pyinstaller, but I've had success with auto-pye-to-exe as an alternative.

Teejay Bruno
  • 1,716
  • 1
  • 4
  • 11
  • It was a execution error because the program couldn't find a specific module added in the code. However by using auto-py-to-exe I could solve the problem but it was a little bit ironic because auto-py-to-exe uses pyinstaller to convert from .py to .exe. Anyway thank you for the tip – blockout Apr 12 '20 at 00:36