install_sct_log.txt (43.5 KB)
I’ve tried both Option 1 and Option 2 on Installation for MacOS - Spinal Cord Toolbox documentation. In both cases, the installation fails.
install_sct_log.txt (43.5 KB)
I’ve tried both Option 1 and Option 2 on Installation for MacOS - Spinal Cord Toolbox documentation. In both cases, the installation fails.
Hi @lisaeylee,
It looks like one of our dependencies (wandb) has begun requiring macOS 12 or higher, however it appears as though you are on macOS 11.5.2.
If possible, I would recommend upgrading your macOS version, as macOS 11 is “end of life” as of 2023:
That said, as a short-term workaround, you can use an older version of “wandb” and the installation should work.
Steps:
.zip to the directory where you wish to install SCT (e.g. ~/sct_v7.2)requirements-freeze.txt”install_sct.Our apologies for the inconvenience, and thank you for your understanding.
Kindly,
Joshua
Thank you for your help. For this download that you sent, I’m unable to run install_sct with the note “install_sct cannot be opened because it’s from an unidentified developer”.
spinalcordtoolbox % ./install_sct
shell-init: error retrieving current directory: getcwd: cannot access parent directories: Operation not permitted
bash: ./install_sct: Operation not permitted
I did not have this error message with previous installation steps. What can I try next?
Thank you for letting me know! This error seems to be related to the macOS security feature “Gatekeeper” which prevents scripts from being run from unknown sources.
I am looking for a way to bypass this, give me one second!
Could you please try removing the quarantine flag from the installer script?
xattr -d com.apple.quarantine install_sct
./install_sct
Where do I run that? Do I have to be in a specific directory then, run that command line?
spinalcordtoolbox % xattr -d com.apple.quarantine install_sct
xattr: install_sct: No such xattr: com.apple.quarantine
Yes, exactly. You got it right, however the fix didn’t work.
Next, can you try the instructions on this page? Open a Mac app from an unknown developer - Apple Support (CA)
(My apologies for the hassle, this is the first time we have seen this error.)
No worries, thank you for your help. I would like to make sure I have the SCT v7.2 going for tomorrow’s SCT workshop.
I updated my macOS to Tahoe (Version 26.1). I’ve followed the steps you most recently suggested to open a Mac app from an unknown developer. Then, in the spinalcrodtoolbox-7.2 folder, I went to the file, requirements-freeze.txt, then, changed line 146 from “wandb==0.23.1” to “wandb==0.21.4". Then, I ran your suggested command line, which now worked:
xattr -d com.apple.quarantine install_sct
./install_sct
I think I followed all your suggested steps. Please correct me if I misunderstood or missed anything. Now, it notes “installation finished successfully!” but the sct_check_dependencies show:
–
Spinal Cord Toolbox (git-master-a631c4d978cbd1d8a5e14da4b7a30e244eca2f9c)
sct_check_dependencies
–
SYSTEM INFORMATION
SCT info:
version: git-master-a631c4d978cbd1d8a5e14da4b7a30e244eca2f9c
path: /Users/msresearch/spinalcordtoolbox
OS: osx (macOS-26.1-x86_64-i386-64bit)
CPU cores: Available: 8, Used by ITK functions: 8
RAM: Total: 8192MB, Used: 1064MB, Available: 752MB
OPTIONAL DEPENDENCIES
Check FSLeyes version…[OK] (1.0.13)
MANDATORY DEPENDENCIES
Check Python executable…[OK]
Using bundled python 3.9.19 (main, May 6 2024, 14:46:57)
[Clang 14.0.6 ] at /Users/msresearch/spinalcordtoolbox/python/envs/venv_sct/bin/python
Check if data are installed…[OK]
Check if dipy is installed…[OK] (1.8.0)
/Users/msresearch/spinalcordtoolbox/spinalcordtoolbox/scripts/sct_check_dependencies.py:163: UserWarning: Private repos not supported. Skipping.
for req in requirements.parse(requirements_txt):
Check if ivadomed is installed…[OK] (2.9.10)
Check if matplotlib is installed…[OK] (3.9.0)
Check if matplotlib-inline is installed…[OK]
Check if monai is installed…[OK] (1.3.1)
Check if nibabel is installed…[OK] (5.2.1)
Check if nilearn is installed…[OK] (0.10.4)
Check if nnunetv2 is installed…[OK]
Check if numpy is installed…[OK] (1.26.4)
Check if onnxruntime is installed…[OK] (1.18.0)
Check if pandas is installed…[OK] (1.5.3)
Check if portalocker is installed…[OK] (2.8.2)
Check if psutil is installed…[OK] (6.0.0)
Check if pyqt5 (5.12.3) is installed…[OK] (5.12.3)
Check if pyqt5-sip is installed…[OK]
Check if pystrum is installed…[OK] (0.4)
Check if pytest is installed…[OK] (8.2.2)
Check if pytest-cov is installed…[OK] (5.0.0)
Check if requests is installed…[OK] (2.32.3)
Check if requirements-parser is installed…[OK] (0.9.0)
Check if scipy is installed…[OK] (1.13.1)
Check if scikit-image is installed…[OK] (0.24.0)
Check if scikit-learn is installed…/Users/msresearch/spinalcordtoolbox/python/envs/venv_sct/lib/python3.9/site-packages/threadpoolctl.py:1214: RuntimeWarning:
Found Intel OpenMP (‘libiomp’) and LLVM OpenMP (‘libomp’) loaded at
the same time. Both libraries are known to be incompatible and this
can cause random crashes or deadlocks on Linux when loaded in the
same Python program.
Using threadpoolctl may cause crashes or deadlocks. For more
information and possible workarounds, please see
threadpoolctl/multiple_openmp.md at master · joblib/threadpoolctl · GitHub
warnings.warn(msg, RuntimeWarning)
[OK] (1.5.0)
Check if xlwt is installed…[OK] (1.3.0)
Check if tqdm is installed…[OK] (4.66.4)
Check if transforms3d is installed…[OK] (0.4.2)
Check if urllib3 is installed…[OK] (2.2.2)
Check if pytest_console_scripts is installed…[OK]
Check if pyyaml is installed…[OK] (6.0.1)
Check if voxelmorph is installed…[OK] (0.2)
Check if wquantiles is installed…[OK] (0.4)
Check if xlsxwriter is installed…[OK] (3.2.0)
Check if spinalcordtoolbox is installed…[OK]
Check ANTs compatibility with OS …[OK]
Check PropSeg compatibility with OS …[OK]
Check if figure can be opened with PyQt…[OK]
Check if figure can be opened with matplotlib…[OK] (Using GUI backend: ‘qtagg’)
What else needs to be done? I’m not sure if SCT v7.2 was downloaded correctly. For example, following the SCT workshop, when I try to run the following command line, which requires SCT v7.2, I get the below error message.
> sct_deepseg spinalcord -i t2.nii.gz -qc ~/qc_singleSubj
(base) msresearch@MSs-MacBook-Pro t2 % sct_deepseg spinalcord -i t2.nii.gz -qc ~/qc_singleSubj
–
Spinal Cord Toolbox (git-master-a631c4d978cbd1d8a5e14da4b7a30e244eca2f9c)sct_deepseg spinalcord -i t2.nii.gz -qc /Users/msresearch/qc_singleSubj
usage: sct_deepseg [-i [ …]] [-c [ …]] [-o ]
[-task [ …]] [-list-tasks]
[-install {seg_sc_t2star,seg_mice_sc,seg_mice_gm,seg_tumor_t2,seg_ms_sc_mp2rage,seg_ms_lesion_mp2rage,seg_tumor-edema-cavity_t1-t2,seg_exvivo_gm-wm_t2,seg_gm_sc_7t_t2star,seg_lumbar_sc_t2w,seg_sc_contrast_agnostic,seg_sc_lesion_t2w_sci,seg_spinal_rootlets_t2w,seg_mouse_gm_wm_t1w,seg_sc_ms_lesion_stir_psir,seg_sc_epi}]
[-thr ] [-r {0,1}] [-largest KEEP_LARGEST] [-fill-holes {0,1}]
[-remove-small REMOVE_SMALL [REMOVE_SMALL …]] [-qc ]
[-qc-dataset ] [-qc-subject ] [-v ] [-h]Segment an anatomical structure or pathologies according to the specified deep learning model.
INPUT/OUTPUT:
-i [ …]
Image to segment. Can be multiple images (separated with space).
-c [ …] Contrast of the input. The-coption is only relevant for the following
tasks:
- ‘seg_tumor-edema-cavity_t1-t2’: Specifies the contrast order of input
images (e.g. -c t1 t2)
- ‘seg_sc_ms_lesion_stir_psir’: Specifies whether input should be
inverted based on contrast (-c stir: no inversion, -c psir: inverted)
Because all other models have only a single input contrast, the ‘-c’
option is ignored for them.
-o Output file name. In case of multi-class segmentation, class-specific
suffixes will be added. By default,the suffix specified in the packaged
model will be added and output extension will be .nii.gz.TASKS:
-task [ …]
Task to perform. It could either be a pre-installed task, task that could
be installed, or a custom task. To list available tasks, run: sct_deepseg
-list-tasks. To use a custom task, indicate the path to the ivadomed
packaged model (see
Pre-trained models — ivadomed documentation
format for more details). More than one path can be indicated (separated
with space) for cascaded application of the models.
-list-tasks Display a list of tasks, along with detailed descriptions (including
information on how the model was trained, what data it was trained on, any
performance evaluations, associated papers, etc.) (default: False)
-install {seg_sc_t2star,seg_mice_sc,seg_mice_gm,seg_tumor_t2,seg_ms_sc_mp2rage,seg_ms_lesion_mp2rage,seg_tumor-edema-cavity_t1-t2,seg_exvivo_gm-wm_t2,seg_gm_sc_7t_t2star,seg_lumbar_sc_t2w,seg_sc_contrast_agnostic,seg_sc_lesion_t2w_sci,seg_spinal_rootlets_t2w,seg_mouse_gm_wm_t1w,seg_sc_ms_lesion_stir_psir,seg_sc_epi}, -install-task {seg_sc_t2star,seg_mice_sc,seg_mice_gm,seg_tumor_t2,seg_ms_sc_mp2rage,seg_ms_lesion_mp2rage,seg_tumor-edema-cavity_t1-t2,seg_exvivo_gm-wm_t2,seg_gm_sc_7t_t2star,seg_lumbar_sc_t2w,seg_sc_contrast_agnostic,seg_sc_lesion_t2w_sci,seg_spinal_rootlets_t2w,seg_mouse_gm_wm_t1w,seg_sc_ms_lesion_stir_psir,seg_sc_epi}
Install models that are required for specified task.PARAMETERS:
-thr Binarize segmentation with specified threshold. Set to 0 for no
thresholding (i.e., soft segmentation). Default value is model-specific
and was set during optimization (more info at https://github.com/sct-
pipeline/deepseg-threshold).
-r {0,1} Remove temporary files. (default: 1)
-largest KEEP_LARGEST
Keep the largest connected-objects from the output segmentation. Specify
the number of objects to keep.To keep all objects, set to 0
-fill-holes {0,1} Fill small holes in the segmentation.
-remove-small REMOVE_SMALL [REMOVE_SMALL …]
Minimal object size to keep with unit (mm3 or vox). A single value can be
provided or one value per prediction class. Single value example: 1mm3,
5vox. Multiple values example: 10 20 10vox (remove objects smaller than 10
voxels for class 1 and 3, and smaller than 20 voxels for class 2).MISC:
-qc The path where the quality control generated content will be saved.
-qc-dataset If provided, this string will be mentioned in the QC report as the dataset
the process was run on.
-qc-subject If provided, this string will be mentioned in the QC report as the subject
the process was run on.
-v Verbosity. 0: Display only errors/warnings, 1: Errors/warnings + info
messages, 2: Debug mode (default: 1)
-h, --help Show this help message and exitTASK DESCRIPTION
seg_sc_t2star Cord segmentation on T2*-weighted contrast
seg_mice_sc Cord segmentation on mouse MRI
seg_mice_gm Gray matter segmentation on mouse MRI
seg_tumor_t2 Cord tumor segmentation on T2-weighted contrast
seg_ms_sc_mp2rage Cord segmentation on MP2RAGE in MS patients
seg_ms_lesion_mp2rage MS lesion segmentation on cropped MP2RAGE data
seg_tumor-edema-cavity_t1-t2 Multiclass cord tumor/edema/cavity segmentation
seg_exvivo_gm-wm_t2 Grey/white matter seg on exvivo human T2w
seg_gm_sc_7t_t2star SC/GM seg on T2*-weighted contrast at 7T
seg_lumbar_sc_t2w Lumbar cord segmentation with 3D UNet
seg_sc_contrast_agnostic Spinal cord segmentation agnostic to MRI contrasts
seg_sc_lesion_t2w_sci Traumatic SCI spinal cord/lesion seg for T2w contrast
seg_spinal_rootlets_t2w Segmentation of spinal nerve rootlets for T2w contrast
seg_mouse_gm_wm_t1w Exvivo mouse GM/WM segmentation for T1w contrast
seg_sc_ms_lesion_stir_psir Segmentation of spinal cord and MS lesions for STIR and PSIR
contrasts
seg_sc_epi Spinal cord segmentation for EPI-BOLD fMRI dataLegend: installed | not installed
To read in-depth descriptions of the training data, model architecture, etc. used for these tasks,
type the following command:sct_deepseg -list-taskssct_deepseg: error: unrecognized arguments: spinalcord
I think you are correct that 7.2 has not downloaded correctly. Based on the string of letters and numbers shown above (git-master-a631c4d978cbd1d8a5e14da4b7a30e244eca2f9c), it seems that you have somehow ended up with a version of SCT from mid-2024.
I am not sure how you have arrived at this copy, but thankfully now that you have updated your macOS machine, you should be able to forego all of the previous fixes and simply use the “recommended” normal method of installing SCT (i.e. via the ./install_sct-7.2_macos.sh script).
My deepest apologies again for the difficulties, and thank you for your patience. ![]()
Kind regards,
Joshua
I was working with Julien’s team on CanProCo study and was suggested to download the SCT version that I currently have in around mid 2024 while it was still in development for a separate issue.
I updated my macOS machine and tried Option 1 in: Installation for MacOS - Spinal Cord Toolbox documentation, as you suggested too.
But, I run into the same issue, where at the end, it notes “installation finished successfully”, but when I sct_check_dependencies, it still hasn’t updated to SCT v7.2.
Would you be open to meeting on Zoom any time after the SCT workshop (and before tomorrow’s SCT workshop) so I can share screen and walk through this issue together? If not, what else do you suggest I try?
Thanks!
Would you be open to meeting on Zoom any time after the SCT workshop (and before tomorrow’s SCT workshop) so I can share screen and walk through this issue together?
Sure! Please feel free to reach out to me at joshua.newton@polymtl.ca after the workshop has finished today (assuming we can’t resolve the issue prior to the end of the day).
But, I run into the same issue, where at the end, it notes “installation finished successfully”, but when I sct_check_dependencies, it still hasn’t updated to SCT v7.2.
Ah, I see! That makes sense.
So, from my understanding, you have several versions of SCT installed (including this older version). Normally, what is supposed to happen is the most recently installed version of SCT will take precedence over older versions (assuming you selected “yes” to question about adding SCT to the PATH during the installation). However, this will only take effect after you open a new terminal window (post-installation) or after you run the command source ~/.zshrc.
So, just to troubleshoot: Does the issue still occur in a fresh terminal window?
And, if the issue persists, can you share the output of the following command?
echo $PATH
Thank you kindly,
Joshua
Resolved! I followed all steps correctly, then, simply needed to open a new terminal window post-installation. Thank you for reminding me that. Please mark this conversation thread resolved, and no need to meet after the workshop anymore. Thank you again!