Running python file in Slicer on Mac

Can anyone help me with the commands here? I want to run a deep learning model in the 3D slicer. I have the file on my desktop. I tried to run it on a mac terminal as well as on 3D-Slicer. I am not able to proceed further. It is showing invalid syntax.

  • Anyone please help me here with the commands.

Thank you

Deep learning works well on Windows and Linux and should work on some macOS systems, too. Please provide more information about your system (what CPU, GPU, and operating system do you use), what commands you execute and errors you get.

-Apple M1 chip
-8-core CPU
-8-core GPU

I am completely new to this software. Any references or any links related to this is very helpful for me.

The command I used was from one of the discussions in this forum

/Applications/Slicer.app/Contents/MacOS/Slicer --no-splash --no-main-window --python-script /Users/ashu/Desktop/test.py

This looks good overall. What is in test.py? What error message do you get?

The file has a complete python code with nothing related to the slicer. My code does produce results when running on Google Colab. I want it to show output in 3d Slicer

qSlicerMarkupsModulePrivate::addToolBar: no main window is available, toolbar is not added
qSlicerSequencesModulePrivate::addToolBar: no main window is available, toolbar is not added
Traceback (most recent call last):
File “”, line 5, in < module >
File “”, line 421, in < module >
NameError: name ‘null’ is not defined