Python api Py2app

Hello, I hope you’re doing great .
I’m not sure this is the good place to ask for such help :

I’m trying to make an app for Mac users of my company .

This app is just a basic file renamer, but witch uses our shotgun asset data base for getting base names .

I made the python script, using TkInter, shotgun_api3, and some other basic modules

The scripts runs perfectly on my machine .

The compiled script app works on my machine aswell , but if I share the app ( from the Dist folder )

It doesn’t run on other machines .

Is there something I’m doing wrong in the process ? i must say i’m quite new to this so i’m probably missing something obvious

Is there some code to add in the script to make it standalone ?

I hope i can get help with this .
thanks a lot in advance .


This sounds like it is probably not an issue specifically with Shotgun, but more of an issue with compiling your code?

  • When you say it doesn’t run, do you get any feedback as to why it didn’t run, any errors?
  • I would perhaps try simplifying your app to narrow down the potential cause. Start cutting things out.

i made few tests, and it’s only when i have the shotgun module called that i’ve got the issue .
the error message that pops up is “failed to run Renamer” ( Renamer is the name of my app )
i definitely get to re-compile without the -windowed command, in order to , perhaps, get some clue displayed in terminal …


Ah OK, fair enough. I don’t have a lot of experience using Py2app,( I think I did use it once years ago) but I’m not sure what is going on here.
I would have a guess that perhaps the Shotgun API was not packaged up correctly. But maybe someone else will have some ideas.

Is the Shotgun API stored in your site packages, or are you appending the sys path at run time to it?
Basically can the build find the Shotgun API to package it?

1 Like

i’m still running test to see what’s going on and what’s not, but apparently, my was not good (at all)
you put me on good tracks with:

can the build find the Shotgun API to package it

therefore i changed it, adding this :

OPTIONS = dict(
            includes = [
            argv_emulation = True)

so far it seems to be running, and to be portable on iMac that don’t have python3 nor shotgun_api3 installed

so thanks a lot .