Failed installation of the new version

Hi,

I am new to Spinal Cord Toolbox. I am trying to install the new version to my macOS High Sierra version 10.13.6 (it is an older laptop). I have not installed any previous versions, and I get the attached error. Any help would be appreciated.

Thanks!

Dave

install_sct_log.txt (16.4 KB)

Dear @Dave,

Thank you for your question, and for providing the install_sct_log.txt file! This greatly helps in debugging your issue.

SCT does not officially support versions of macOS older than Big Sur (11). (Our documentation seems to be out of date, so I will make a note to fix this ASAP.)

That said, I will try my best to see what I can do to help get things up and running. :slight_smile:


The easiest way to solve this issue is to try to install an older version of SCT to find one that supports macOS 10.13. You won’t have all of the newest SCT features, but you will still have the core functionality, and it will guarantee that it’s a version we’ve tested thoroughly against macOS 10.13.

Looking at older forum posts, I’ve come across Failed install - version 5.7, MacOS High Sierra. From this post, I would suggest to try version SCT v5.6. To install this older version, download the “Source Code (.zip)”, extract the code, then run the install_sct script contained within.


To help clarify why 10.13 isn’t supported, the error message appears to be due to the installation of onnxruntime, one of the packages that SCT depends on:

Technical details behind downgrading onnxruntime
  • Currently, for v6.4, SCT specifies the version onnxruntime==1.18.1 (released in June 2024)
  • However, the onnxruntime developers have limited their package so that it can only be installed on macOS 11 or higher. (You can tell this because the package name is called onnxruntime-1.18.1-cp39-cp39-macosx_11_0_universal2.whl)
  • So, we would have to explicitly specify an earlier version of onnxruntime for the installation to succeed. Looking back in time at the release history, we can see that:
    • Version 1.16.3 (Nov 2023) loosens the requirements to support macOS 10.15 or higher. However, it seems that this is still too high for your workstation to support.
    • Version 1.10.0 (Dec 2021) loosens the requirements further, but still only supports macOS 10.14 or higher.
    • To get to a version that supports macOS 10.13, we would need to downgrade onnxruntime to version 1.8.1 (July 2021), which supports macOS 10.12 or higher.

To downgrade the version of onnxruntime:

  1. Navigate to the folder that you chose for the installation location. (In this case, navigate to the folder /Users/davidwarrenmartin/sct_6.4.)
  2. Open the file called requirements-freeze.txt. This will show all of the requirements used by SCT.
  3. Edit the onnxruntime line so that it says onnxruntime=1.8.1 instead of onnxruntime=1.18.1.
  4. Save the file, and then run the install script again, but this time run the copy of the installer script that already exists in the sct_6.4 folder. (This will prevent your changes from being overwritten).
# ensure that the install script is executable
chmod +x /Users/davidwarrenmartin/sct_6.4/install_sct
# run the installer using the '-i' option (in-place) to use your changes
. /Users/davidwarrenmartin/sct_6.4/install_sct -iy

I tested this change locally on my Ubuntu machine, and onnxruntime==1.8.1 worked OK for me (i.e. it does not conflict with any other packages).

However, due to the age of your OS, there is a good chance that there are other packages that will need to be downgraded in this same manner. You may need to iterate (install → error → find older package version → install → etc.). I am not 100% sure if this would be successful even if we found the necessary package versions, but it could be worth a shot depending on your needs. My apologies, though, as this is largely beyond our control.

Kind regards,
Joshua

Thanks Joshua! I really appreciate your response.

I will try to download an older version and see where it takes me. I might need more help in the process.

Of course! Feel free to provide updates in this thread, and I will be happy to troubleshoot further. :slight_smile:

Hi Joshua,

I appreciate the offer for further help. I’m going to have to take you up on that, as the installation failed a second time. The documentation is attached.

install_sct_log.txt (52.4 KB)

Thanks!

Dave

Hi @Dave,

Not a worry! The good news is that the installer got much further than before, and you have a (mostly) working installation. From the log, though, we see:

ImportError: dlopen(/Users/davidwarrenmartin/sct_5.6/python/envs/venv_sct/lib/python3.7/site-packages/PIL/_imaging.cpython-37m-darwin.so, 2): Symbol not found: ____chkstk_darwin
  Referenced from: /Users/davidwarrenmartin/sct_5.6/python/envs/venv_sct/lib/python3.7/site-packages/PIL/.dylibs/libtiff.5.dylib (which was built for Mac OS X 11.0)
  Expected in: /usr/lib/libSystem.B.dylib
 in /Users/davidwarrenmartin/sct_5.6/python/envs/venv_sct/lib/python3.7/site-packages/PIL/.dylibs/libtiff.5.dylib

This exact error message is also reported in this StackOverflow thread. It comes with the following solution:

# Commands have been modified to reference the SCT installation directory
"$SCT_DIR/python/envs/venv_sct/bin/pip3" uninstall Pillow -y
brew install libjpeg libtiff little-cms2 openjpeg webp
"$SCT_DIR/python/envs/venv_sct/bin/python3" -m pip install --upgrade pip
"$SCT_DIR/python/envs/venv_sct/bin/python3" -m pip install --upgrade Pillow --no-binary :all:

# Validate the SCT installation
sct_check_dependencies

Could you please try these 4 commands, and then run the sct_check_dependencies command once more and see if you run into the same error?

Kind regards,
Joshua

Hi Joshua,

I really appreciate the help. I am really new to this, and I can’t seem to run the commands from the terminal. I tried moving to the directory recommended in the solution you provided, but pip3 is not a directory. More significantly, uninstall is not recognized as a command.

Clearly, I am missing something.

Thanks!

Dave

Dear @Dave,

My deepest apologies for the delay in response. I missed the notification, and I am very sorry!

To clarify: The “"$SCT_DIR/python/envs/venv_sct/bin/” part of the commands is very important. It points directly at the various executables contained within the SCT installation. I notice in your screenshot that this part is excluded, hence the “command not found” errors.

I would recommend to copy and paste the commands exactly as shared – they should work from any location, so there is no need to cd at all. :slight_smile:

That said, I do notice that the brew command also failed. So, I would also recommend following the instructions on https://brew.sh/ before proceeding.

Kind regards,
Joshua

Hi @joshuacwnewton Thank you for your reply!

I ran the commands as you gave them, and tried installing Homebrew. However the installation of Homebrew failed because of the age of my laptop. As such, the final command to upgrade Pillow also failed.

I’ve noticed that SCT has some functionality as is, so I think I’ll try to work with what I have, and see where that goes.

Much appreciated,

Dave