Issue to Install SCT on MAC M 1

Description

I have a new MAC M1 and I am trying to follow the instructions for SCT installation using the command line on my terminal ./install_sct

Commands and terminal output

./install_sct


*******************************
* Welcome to SCT installation *
*******************************



Checking OS type and version...

Darwin SV-69M-031 20.5.0 Darwin Kernel Version 20.5.0: Sat May  8 05:10:31 PDT 2021; root:xnu-7195.121.3~9/RELEASE_ARM64_T8101 arm64
ProductVersion:	11.4

Checking requirements...


OK!


SCT version ......... dev
Installation type ... in-place
Operating system .... osx (11.4)
Shell config ........ /Users/bachali/.bashrc

To improve user experience and fix bugs, the SCT development team is using a
report system to automatically receive crash reports and errors from users.
These reports are anonymous.

Do you agree to help us improve SCT? [y]es/[n]o: y

--> Crash reports will be sent to the SCT development team. Thank you!


SCT will be installed here: [/Users/bachali/desktop/spinalcordtoolbox]



Do you agree? [y]es/[n]o: y

Do you want to add the sct_* scripts to your PATH environment? [y]es/[n]o: y

Skipping copy of source files (source and destination folders are the same)


Installing conda...


rm -rf /Users/bachali/desktop/spinalcordtoolbox/python


mkdir -p /Users/bachali/desktop/spinalcordtoolbox/python


curl -o /var/folders/lw/jty1xr614w33qrycd0bmwdfc0000gp/T/tmp.PyUYaYhP/miniconda.sh -L https://repo.anaconda.com/miniconda/Miniconda3-latest-MacOSX-x86_64.sh

  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100 54.4M  100 54.4M    0     0  8206k      0  0:00:06  0:00:06 --:--:-- 9154k

bash /var/folders/lw/jty1xr614w33qrycd0bmwdfc0000gp/T/tmp.PyUYaYhP/miniconda.sh -p /Users/bachali/desktop/spinalcordtoolbox/python -b -f

PREFIX=/Users/bachali/desktop/spinalcordtoolbox/python
Unpacking payload ...
Collecting package metadata (current_repodata.json): done                       
Solving environment: done

## Package Plan ##

  environment location: /Users/bachali/desktop/spinalcordtoolbox/python

  added / updated specs:
    - brotlipy==0.7.0=py38h9ed2024_1003
    - ca-certificates==2020.10.14=0
    - certifi==2020.6.20=pyhd3eb1b0_3
    - cffi==1.14.3=py38h2125817_2
    - chardet==3.0.4=py38hecd8cb5_1003
    - conda-package-handling==1.7.2=py38h22f3db7_0
    - conda==4.9.2=py38hecd8cb5_0
    - cryptography==3.2.1=py38hbcfaee0_1
    - idna==2.10=py_0
    - libcxx==10.0.0=1
    - libedit==3.1.20191231=h1de35cc_1
    - libffi==3.3=hb1e8313_2
    - ncurses==6.2=h0a44026_1
    - openssl==1.1.1h=haf1e3a3_0
    - pip==20.2.4=py38hecd8cb5_0
    - pycosat==0.6.3=py38h1de35cc_1
    - pycparser==2.20=py_2
    - pyopenssl==19.1.0=pyhd3eb1b0_1
    - pysocks==1.7.1=py38_1
    - python.app==2=py38_10
    - python==3.8.5=h26836e1_1
    - readline==8.0=h1de35cc_0
    - requests==2.24.0=py_0
    - ruamel_yaml==0.15.87=py38haf1e3a3_1
    - setuptools==50.3.1=py38hecd8cb5_1
    - six==1.15.0=py38hecd8cb5_0
    - sqlite==3.33.0=hffcf06c_0
    - tk==8.6.10=hb0a8c7a_0
    - tqdm==4.51.0=pyhd3eb1b0_0
    - urllib3==1.25.11=py_0
    - wheel==0.35.1=pyhd3eb1b0_0
    - xz==5.2.5=h1de35cc_0
    - yaml==0.2.5=haf1e3a3_0
    - zlib==1.2.11=h1de35cc_3


The following NEW packages will be INSTALLED:

  brotlipy           pkgs/main/osx-64::brotlipy-0.7.0-py38h9ed2024_1003
  ca-certificates    pkgs/main/osx-64::ca-certificates-2020.10.14-0
  certifi            pkgs/main/noarch::certifi-2020.6.20-pyhd3eb1b0_3
  cffi               pkgs/main/osx-64::cffi-1.14.3-py38h2125817_2
  chardet            pkgs/main/osx-64::chardet-3.0.4-py38hecd8cb5_1003
  conda              pkgs/main/osx-64::conda-4.9.2-py38hecd8cb5_0
  conda-package-han~ pkgs/main/osx-64::conda-package-handling-1.7.2-py38h22f3db7_0
  cryptography       pkgs/main/osx-64::cryptography-3.2.1-py38hbcfaee0_1
  idna               pkgs/main/noarch::idna-2.10-py_0
  libcxx             pkgs/main/osx-64::libcxx-10.0.0-1
  libedit            pkgs/main/osx-64::libedit-3.1.20191231-h1de35cc_1
  libffi             pkgs/main/osx-64::libffi-3.3-hb1e8313_2
  ncurses            pkgs/main/osx-64::ncurses-6.2-h0a44026_1
  openssl            pkgs/main/osx-64::openssl-1.1.1h-haf1e3a3_0
  pip                pkgs/main/osx-64::pip-20.2.4-py38hecd8cb5_0
  pycosat            pkgs/main/osx-64::pycosat-0.6.3-py38h1de35cc_1
  pycparser          pkgs/main/noarch::pycparser-2.20-py_2
  pyopenssl          pkgs/main/noarch::pyopenssl-19.1.0-pyhd3eb1b0_1
  pysocks            pkgs/main/osx-64::pysocks-1.7.1-py38_1
  python             pkgs/main/osx-64::python-3.8.5-h26836e1_1
  python.app         pkgs/main/osx-64::python.app-2-py38_10
  readline           pkgs/main/osx-64::readline-8.0-h1de35cc_0
  requests           pkgs/main/noarch::requests-2.24.0-py_0
  ruamel_yaml        pkgs/main/osx-64::ruamel_yaml-0.15.87-py38haf1e3a3_1
  setuptools         pkgs/main/osx-64::setuptools-50.3.1-py38hecd8cb5_1
  six                pkgs/main/osx-64::six-1.15.0-py38hecd8cb5_0
  sqlite             pkgs/main/osx-64::sqlite-3.33.0-hffcf06c_0
  tk                 pkgs/main/osx-64::tk-8.6.10-hb0a8c7a_0
  tqdm               pkgs/main/noarch::tqdm-4.51.0-pyhd3eb1b0_0
  urllib3            pkgs/main/noarch::urllib3-1.25.11-py_0
  wheel              pkgs/main/noarch::wheel-0.35.1-pyhd3eb1b0_0
  xz                 pkgs/main/osx-64::xz-5.2.5-h1de35cc_0
  yaml               pkgs/main/osx-64::yaml-0.2.5-haf1e3a3_0
  zlib               pkgs/main/osx-64::zlib-1.2.11-h1de35cc_3


Preparing transaction: done
Executing transaction: done
installation finished.
Collecting package metadata (current_repodata.json): done
Solving environment: done


==> WARNING: A newer version of conda exists. <==
  current version: 4.9.2
  latest version: 4.10.1

Please update conda by running

    $ conda update -n base -c defaults conda



## Package Plan ##

  environment location: /Users/bachali/desktop/spinalcordtoolbox/python/envs/venv_sct

  added / updated specs:
    - python=3.6


The following packages will be downloaded:

    package                    |            build
    ---------------------------|-----------------
    ca-certificates-2021.4.13  |       hecd8cb5_1         114 KB
    certifi-2020.12.5          |   py36hecd8cb5_0         141 KB
    openssl-1.1.1k             |       h9ed2024_0         2.2 MB
    pip-21.1.1                 |   py36hecd8cb5_0         1.8 MB
    python-3.6.13              |       h88f2d9e_0        16.8 MB
    readline-8.1               |       h9ed2024_0         333 KB
    setuptools-52.0.0          |   py36hecd8cb5_0         710 KB
    sqlite-3.35.4              |       hce871da_0         1.1 MB
    wheel-0.36.2               |     pyhd3eb1b0_0          33 KB
    ------------------------------------------------------------
                                           Total:        23.3 MB

The following NEW packages will be INSTALLED:

  ca-certificates    pkgs/main/osx-64::ca-certificates-2021.4.13-hecd8cb5_1
  certifi            pkgs/main/osx-64::certifi-2020.12.5-py36hecd8cb5_0
  libcxx             pkgs/main/osx-64::libcxx-10.0.0-1
  libffi             pkgs/main/osx-64::libffi-3.3-hb1e8313_2
  ncurses            pkgs/main/osx-64::ncurses-6.2-h0a44026_1
  openssl            pkgs/main/osx-64::openssl-1.1.1k-h9ed2024_0
  pip                pkgs/main/osx-64::pip-21.1.1-py36hecd8cb5_0
  python             pkgs/main/osx-64::python-3.6.13-h88f2d9e_0
  readline           pkgs/main/osx-64::readline-8.1-h9ed2024_0
  setuptools         pkgs/main/osx-64::setuptools-52.0.0-py36hecd8cb5_0
  sqlite             pkgs/main/osx-64::sqlite-3.35.4-hce871da_0
  tk                 pkgs/main/osx-64::tk-8.6.10-hb0a8c7a_0
  wheel              pkgs/main/noarch::wheel-0.36.2-pyhd3eb1b0_0
  xz                 pkgs/main/osx-64::xz-5.2.5-h1de35cc_0
  zlib               pkgs/main/osx-64::zlib-1.2.11-h1de35cc_3



Downloading and Extracting Packages
pip-21.1.1           | 1.8 MB    | ##################################### | 100% 
ca-certificates-2021 | 114 KB    | ##################################### | 100% 
sqlite-3.35.4        | 1.1 MB    | ##################################### | 100% 
wheel-0.36.2         | 33 KB     | ##################################### | 100% 
readline-8.1         | 333 KB    | ##################################### | 100% 
python-3.6.13        | 16.8 MB   | ##################################### | 100% 
setuptools-52.0.0    | 710 KB    | ##################################### | 100% 
certifi-2020.12.5    | 141 KB    | ##################################### | 100% 
openssl-1.1.1k       | 2.2 MB    | ##################################### | 100% 
Preparing transaction: done
Verifying transaction: done
Executing transaction: done
#
# To activate this environment, use
#
#     $ conda activate venv_sct
#
# To deactivate an active environment, use
#
#     $ conda deactivate

Error: Activating venv_sct failed to switch Python interpreter to Miniconda. (Incorrect interpreter loaded: /Users/bachali/desktop/spinalcordtoolbox/python/envs/venv_sct/bin/python3.6)

1 Like

Hi @idris!

I have an M1 mac and was able to install SCT a few months ago I believe.

Could you try the following commands and show what gets printed out for each of them?

which python
where python
where conda
echo $PATH

which python
/opt/anaconda3/envs/fsleyes_env/bin/python

Where doesn’t work on my mac

echo $PATH

/opt/anaconda3/envs/fsleyes_env/bin:/opt/homebrew/opt/python@3.8/bin:/opt/homebrew/opt/python@3.9/bin:/opt/homebrew/opt/python@3.8/bin:/opt/homebrew/bin:/opt/homebrew/sbin:/opt/homebrew/bin:/opt/homebrew/sbin:/opt/anaconda3/condabin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin

Great - thanks @idris!

Here’s an update on my side, followed by some questions for you and then action tasks:

Update
I was able to install SCT successfully on my side. To do so, I first created a new user on my Mac, and followed the SCT installation instructions from Github (here).

As such, I am suspecting that your issue may be related to your OS/Path configuration and not solely due to having an M1 processor.

Note: we have some differences in our setup.

1 - You have anaconda also installed (per your result of which python).
2 - You are using a bash shell whereas I am using the zshrc shell (this is a change in the latest versions of Apple operating systems.

As such, I installed anaconda, and SCT installed successfully after that.

I also installed SCT successfully after switching from a zshrc shell to bash (+ Anaconda).

Questions for you

Could you please report the following information

  • Your operating system
  • If you migrated to your M1 Mac (transferred all your settings/files from an old laptop) or started from a clean install.

Action tasks for you

If possible, please do the following to help in debugging your issue

  • First, try another installation, but edit the install_sct file (using a file editor) by adding the following after line 618:

echo $EXPECTED_PYTHON
echo $ACTUAL_PYTHON

If you can’t, let me know and I can send you the edited file.

Afterwards, copy or screenshot the output after your attempted installation. eg, this is what I get:

(note the two identical lines for python3.6; you’ll likely get different paths due to your error).

  • Secondly, if possible, create a new user and try to install SCT in that fresh profile. Report back on if it works or not, and the results of the commands I asked you for in my earlier comment.
1 Like

Hi @idris – just wanted to know if you had tried some of my suggestions above to help debug your issue.