Hi everyone,
I’m reposting this from the Builder forum as it seems to be more of a coding/environment issue and hasn’t received a response. I tried to delete the original to prevent duplicating the topic but couldn’t find a way. For full context, the original post is here: RuntimeError: Wrong version of PyObjC C API with added Python package (godirect) and Builder components
The Problem
I am encountering a dependency conflict on macOS when using the godirect package (for a Vernier dynamometer) in an experiment that also uses standard PsychoPy GUI components (e.g., a Button component). My custom code to initialize and use the godirect library works perfectly on its own, but the experiment fails as soon as a GUI component is added to any routine in the project.
System Details
- PsychoPy Version: 2024.2.4
- Operating System: macOS Sequoia 15.4.1 (but the experiment must ultimately run on Windows as well)
- External Package:
godirect, installed viapipfrom the PsychoPy Runner.
The Error
When a GUI component is present in the experiment, I receive the following error, which points to a conflict with the PyObjC library used by PsychoPy and a dependency of godirect:
RuntimeError: Wrong version of PyObjC C API (got 25, expected 21)
What I Have Tried
- Reordering Routines: The error occurs regardless of the order of the routines.
- Package Versions: I’ve tried the latest
godirectversion and older ones with no success. Our lab (ideally) needs to stick with PsychoPy2024.2.4. - Builder vs. Coder: I strongly prefer to solve this within a code block in the Builder. However, I am willing to move to a pure Coder/conda environment solution if that is the only robust path forward.
The experiment is running on a shared lab laptop, so creating a self-contained conda environment is a feasible solution if necessary. I would be super grateful for any tips to solve this issue so I can use the Vernier device within the PsychoPy experiment I already have.
Thank you in advance for any guidance you can provide!