Skip to content

Import spm fails in mpython2 #32

Closed
Closed
@johmedr

Description

@johmedr

Trying to import spm in mwpython2 gives an error:

>>> import spm; spm.Runtime.call('cell', 1, 1)
...
RuntimeError: On the Mac, you must run mwpython rather than python to start a session or script that imports your package. For more details, execute "mwpython -help" or see the package documentation.`

Although the correct executable is run

>>> import sys; print(sys.executable)
/Applications/MATLAB_R2024b.app/bin/maca64/mwpython.app/Contents/MacOS/mwpython

The error comes from the _PathInitializer in spm/_spm/__init__.py expecting DYLD_LIBRARY_PATH to be set instead of DYLD_FALLBACK_LIBRARY_PATH. Replacing DYLD_LIBRARY_PATH by DYLD_FALLBACK_LIBRARY_PATH solves the issue but breaks the compatibility with the native mwpython.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions