0

I really need an updated answer for this question. I want to convert the script into an executable that runs when I'd double click it. Some procedures, available online since last two-three years, are not working. I have just one script that's utilizing selenium and Geckodriver. The response I get against "which python3" is enter image description here

So kindly give answer if you've had yourself performed such a task in last few months.

ForceBru
  • 43,482
  • 10
  • 63
  • 98
Sana Mumtaz
  • 803
  • 7
  • 16

2 Answers2

0

You can use PyInstaller running on a Mac to generate an executable.

LucioRandy
  • 220
  • 1
  • 19
0

PyInstaller didn't work in my case. Maybe it'd work on someone else's system. So, I went the simple "chmod" way and converted the python file into an executable. These were the steps:

  1. On Terminal, I ran which python3 and copy-pasted the result at the start of my python script, preceded with #!
  2. Then I changed the extension of my python file to .command
  3. On Terminal, I ran the command chmod +x fileName.command (755 instead of +x works too)

So, this is how I made my python file executable. There are other solutions too, but this one worked for me and is also simpler.

Sana Mumtaz
  • 803
  • 7
  • 16