Running slicer from mac terminal

Hello,

There are two issues I am facing - not really clear what’s happening. Quite basic actually:

  1. How do you initiate Slicer from mac terminal and run a python script without GUI -the documentation has stuff for Windows
  2. And more importantly, how to run a python script within slicer (using the python inspector)? I am encountering modulenotfound error all the time

Any help would be cool.

Thanks

You can do something like the following:

/Applications/Slicer.app/Contents/MacOS/Slicer --no-splash --no-main-window --python-code "print('hello slicer'); exit()"

Maybe you can suggest edits to any documentation that’s not clear or is too windows-specific? (e.g. issue a pull request through github with change suggestions).

1 Like

@pieper Thank you for the reply :slight_smile: Yes, I finally figured it out - let me just wrap up with the whole thing - then i will post my solution - with some more details - might help future Mac 3d slicer users - not sure if what I did is the best way to do it, but that’s what I could manage and get things to work :stuck_out_tongue:

I didn’t see those instructions added to the docs so I created a pull request with updated instructions in the script repository.

@pieper could you take a look at it?

Thanks @koeglfryderyk, request is merged.

1 Like