Hi SCT Team,

I downloaded the latest release of SCT. I got the following error ;
s4333238@cai-wks3:/90days/s4333238/4322/top$ sct_deepseg -install-task seg_mice_gm-wm_dwi

Spinal Cord Toolbox (5.2.0)

sct_deepseg -install-task seg_mice_gm-wm_dwi

INSTALLING MODEL: model_seg_mice_gm-wm_dwi_unet2d-multichannel-softseg
Traceback (most recent call last):
File “/opt/spinalcordtoolbox-5.2.0/spinalcordtoolbox/scripts/”, line 245, in
File “/opt/spinalcordtoolbox-5.2.0/spinalcordtoolbox/scripts/”, line 148, in main
File “/opt/spinalcordtoolbox-5.2.0/spinalcordtoolbox/deepseg/”, line 139, in install_model[name_model][‘url’], folder(name_model))
File “/opt/spinalcordtoolbox-5.2.0/spinalcordtoolbox/”, line 143, in install_data
os.makedirs(dest_folder, exist_ok=True)
File “/opt/spinalcordtoolbox-5.2.0/python/envs/venv_sct/lib/python3.6/”, line 220, in makedirs
mkdir(name, mode)
OSError: [Errno 30] Read-only file system: ‘/opt/spinalcordtoolbox-5.2.0/data/deepseg_models/model_seg_mice_gm-wm_dwi_unet2d-multichannel-softseg’
I’m not sure whether I’ve done something wrong or software issue.

Could you please have a look at this issue and how to solve it out?

Many thanks in advance…



I was able to reproduce your issue by installing SCT to the opt/ directory (as you have).

opt/ is owned by root by default, and the default permissions are rwxr-xr-x. This means that the owner, root, has write permissions, but “other” users don’t, hence the error.

One solution is to change ownership of the affected folder. This will grant write permissions to the new owner. Could you please run the following command to change the ownership of the SCT directory? (source)

sudo chown -R $USER:$USER /opt/spinalcordtoolbox-5.2.0/

After running this command, I was able to install models OK. :slightly_smiling_face:

Kind regards,

1 Like

Hi @joshuacwnewton,

Thank you very much for your help. Now it’s working as expected. The model has been loaded successfully as instructed.