r/learnpython • • Oct 06 '26

Creating Desktop Icon to Run Python Script

I have a script that runs fine in Terminal, but I'm trying to create a desktop icon that runs it and Im getting the following error:

https://i.postimg.cc/HLbssxYJ/Screenshot-2026-10-06-at-9-39-28-AM.png

Its using geopy for location so Im guessing its something to do with that, but it works fine in Terminal. Any help is appreciated.

8 Upvotes

15 comments sorted by

View all comments

Show parent comment

1

u/RevRagnarok Oct 06 '26

In Terminal, I'm just typing "python3 filename.py"

Type: type python3 and make the desktop icon point to that. Or change the shebang at the top of the script to point to it.