Using the Resolve python API in an exe on Windows

Ask software engineering and SDK questions for developers working on Mac OS X, Windows or Linux.
  • Author
  • Message
Offline

Robert Arnold

  • Posts: 443
  • Joined: Tue Oct 30, 2012 11:53 pm

Using the Resolve python API in an exe on Windows

PostWed Jun 02, 2021 12:48 am

I hope this is the right sub-forum for this question. I've been building a python (3.6.8) app on Mac that I've bundled into an executable that will run even if a user doesn't have Python installed. It interacts with Resolve via the API. Works fine.

I'm now trying to port it to Windows, and it's seeming like fusionscript.dll, or some other dll it calls, is dependent upon a Python install to run, even when I've embedded all of the necessary runtime libraries using pyinstaller. There seems to be just *one* file in the Python install that the fusionscript.dll is dependent upon to run, that being os.py in the Lib folder. This is odd, because the os module is definitely bundled in the exe, , imports without complaint, and performs functions is my script before fusionscript.dll is imported. If os.py is present in its normal install location, the exe starts up fine. If that one file is missing, the exe quits abruptly (and without registering an error) when it hits script_module = imp.load_dynamic("fusionscript", path + "fusionscript" + ext).

Any ideas for a workaround?
Offline

videotoolshed

  • Posts: 2
  • Joined: Fri Apr 30, 2021 6:25 am
  • Real Name: Bouke Vahl

Re: Using the Resolve python API in an exe on Windows

PostWed Jun 02, 2021 4:14 pm

Hi Robert,

Considering the version, are you using FBS to freeze?

If so, did you try putting the needed stuff in the resources/win folder?

(I have no clue what the python API can do, please enlighten me, but putting stuff there has helped me for VLC
support.)
Offline

ambustion

  • Posts: 24
  • Joined: Mon Jun 24, 2019 4:36 pm
  • Real Name: Brendon Rathbone

Re: Using the Resolve python API in an exe on Windows

PostWed Jun 02, 2021 4:18 pm

I can try one of my scripts bundled as an exe, but I've never used the imp.load_dynamic. I'd have to see if that's just because I only tried exe's on a system with python installed. My main thought would be that your path could have issues on windows but that is probably something you had thought of. How are you calling that on windows if that's a possibility?
Offline

Robert Arnold

  • Posts: 443
  • Joined: Tue Oct 30, 2012 11:53 pm

Re: Using the Resolve python API in an exe on Windows

PostThu Jun 03, 2021 12:20 am

ambustion wrote:I can try one of my scripts bundled as an exe, but I've never used the imp.load_dynamic. I'd have to see if that's just because I only tried exe's on a system with python installed. My main thought would be that your path could have issues on windows but that is probably something you had thought of. How are you calling that on windows if that's a possibility?


Are you using the Resolve API? If so, you must be calling DavinciResolveScript.py in order to get an instance of Resolve to nteract with. The imp.load_dynamic is inside that script (which is furnished by BM with their sample scripts.)

Return to Software Developers

Who is online

Users browsing this forum: No registered users and 19 guests