Mac Python support in OBS 26?

claudeheintz

New Member
Does OBS Studio 26 remove python support on the Mac? I downloaded it and my python script disappears. I switched back to 25.0.8 and my script works...

(The script works just fine using OBS Studio 26 on Windows.)
 

claudeheintz

New Member
Maybe I should clarify, the "scripts" window does not have a "Python Settings" tab like 25.0.8. I looked at previous release candidate versions 26r1, 26r3, and neither of them has the python settings tab in scripts.

When I try to add my python script, it is not allowed to be selected.

All of the above does not apply to version 26 on Windows. There the script continues to work as before.

So, for the Mac version, is this a bug? An intentional omission? Other than posting here, where would I find this information as searching these forums and the documentation wiki don't turn up anything?
 

DeckerEgo

New Member
Welp... it appears to have been disabled entirely in 26 - see https://github.com/obsproject/obs-studio/pull/3172
Python scripting support is not in a working state on macOS and with Homebrew updating default Python to v3.8.3 there will be build issues if an updated Python is installed and prioritised over macOS' system Python (as OBS doesn't build successfully with newer Python versions present). Disabling Python scripting support for macOS builds for the time being avoids this issue.
Not sure how this is considered to be a "non-breaking change" since now scripts that ran in 25 will not work in 26.

I couldn't find an issue or open PR for resuming MacOS Python support, so it appears to be gone for the foreseeable future.
 

aega

New Member
Looks like we're stuck on 25.0.8 then, as there's no way I'm upgrading to 26 without Python support (too many scripts that wouldn't work if I converted to Lua). I thought brew made it easy to switch between different Python versions.
 

JamLion

New Member
Well that SUCKS. Come on, OBS. I don't know why they would disable it... unless they're still working on it. In that case, we should wait for version 26.0.1 to come out, as that might have Python support. WEIRD.
 

claudeheintz

New Member
To clarify the original post, Version 25.0.8 did not appear to work with Python 3.8. To make it work, I had to install python 3.7 downloaded from the official Python website and put the path into OBS.

There is a minefield of managing python versions. Apple's current advice to developers for Catalina is to include a local copy of the python framework with the application and link against that. That way, you do not depend on the python installed on the user's computer. And the user does not screw up other python dependancies on their computer by requiring a specific version to be installed. The potential drawback to this approach is using pip to install modules for the application's private python. Perhaps this will resolve if Apple finally upgrades the system default python from 2.7 on the next MacOS version.
 

claudeheintz

New Member
OK, so I wasn't completely correct in the last post either.. OBS 25.0.8 will work with the latest python 3.8.5. But, ONLY if you go to /Library/Frameworks/Python.framework/Versions/3.8 and duplicate the alias "libpython3.8.dylib" and re-name it "libpython3.7m.dylib".

It looks from the log file like OBS 25.0.8 is looking for a hardcoded file or symlink named "libpython3.7m.dylib" to pass to dlopen().

Python 3.7.9 on the mac includes two symlinks in the 3.7/lib folder, "libpython3.7m.dylib" and "libpython3.7.dylib". Both point to the same place. But OBS seems to require specifically the "libpython3.7m.dylib" one.
 

DeckerEgo

New Member
It isn't too bad to manage multiple versions of Python on MacOS using pyenv. As an example, to install the appropriate version of Python with shared libraries for OBS, run:
CONFIGURE_OPTS=--enable-shared pyenv install 3.7.8
 
Top