1

I created a python code which creates a horse racing card betting game. I would like to share this game with my friends, who have macs, who do not have python or know anything about coding so they can play it. I have tried using pyinstaller to convert the file into a stand alone executable app. I used the command

pyinstaller --windowed Horse_Race.py

This works in that it creates a build and dist folder. The dist folder contains the app of the python code. When I run the app, however, it opens briefly (about 1s) then crashes without anything ever displaying on screen. The interesting part is that I can view the package contents of the app and run the code through my terminal by running the UNIX executable file which is within the package contents of the app.

In short the executable file works, however, the app will not run, and I cannot share the file with my friends who have macs because it just shows up as a text file. If anyone knows how to fix this issue or knows another creative way I can send my game to my friends please let me know.

Thanks for your help.

Xeno
  • 23
  • 3
  • 2
    did you search the web ? what OS you are running? There is a lot of videos on youtube that explain how to convert a python application or package into executable or bin pr elf. – Adam May 21 '20 at 15:25
  • I think [this tutorial](https://www.youtube.com/watch?v=UZX5kH72Yx4) might help. – ywbaek May 21 '20 at 15:29
  • Yes, I have searched the web. pyinstaller and py2app where both recommended pip installs to use for this. I tried both of them and I have the issue wehre when I double click the app through finder it opens briefly and then shuts down. – young_coder May 21 '20 at 15:30
  • @ywbaek I checked out the tutorial you sent but I am looking for something that is compatible with macs. – young_coder May 21 '20 at 15:36
  • Try going in terminal and `open ` where app is whatever you click on, not the *package content of the app* (that works). Bit of luck it’ll output whatever error messages cant show up when launched from Finder clicking. Old trick with crashing GUI apps, works even on Windows. Or type `./` to run it, leading dot is important. – JL Peyret May 21 '20 at 16:22
  • Also check https://python.libhunt.com/pyinstaller-alternatives – JL Peyret May 21 '20 at 16:28

1 Answers1

0

here is an easy souloution that saves time and does not require knowledge.

pip install auto-py-to-exe

and then just type

auto-py-to-exe

after typing the code above a window in your web browser will open with a ghraphical gui that looks like this click here to go to image

Xeno
  • 23
  • 3