Can't install SCT due to Network Error (workaround for Iran connection limitations)

Dear sir
I tried six times (to rule out connection problem) to install SCT but it failed. I also tried one of the previous advice as: * Open the install_sct file in a text editor

  • Use Ctrl+F to find the line “pip install -r "$REQUIREMENTS_FILE" &&
  • Change the line to: “pip install -r "$REQUIREMENTS_FILE" --timeout 1000 &&
    but it failed again.
    please help me to install the package.
./install_sct


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



Checking OS type and version...

Linux user-To-be-filled-by-O-E-M 5.4.0-47-generic #51-Ubuntu SMP Fri Sep 4 19:50:52 UTC 2020 x86_64 x86_64 x86_64 GNU/Linux

Checking requirements...


OK!


SCT version ......... dev
Installation type ... package
Operating system .... linux (unknown)
Shell config ........ /home/user/.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: [/home/user/sct_dev]



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

Copying source files from /home/user/Downloads/spinalcordtoolbox-master to /home/user/sct_dev

...............................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................
Installing conda...


rm -rf /home/user/sct_dev/python


mkdir -p /home/user/sct_dev/python


wget -O /tmp/tmp.O35iJIivKT/miniconda.sh https://repo.anaconda.com/miniconda/Miniconda3-latest-Linux-x86_64.sh

--2021-01-20 09:09:37--  https://repo.anaconda.com/miniconda/Miniconda3-latest-Linux-x86_64.sh
Resolving repo.anaconda.com (repo.anaconda.com)... 104.16.130.3, 104.16.131.3, 2606:4700::6810:8303, ...
Connecting to repo.anaconda.com (repo.anaconda.com)|104.16.130.3|:443... connected.
HTTP request sent, awaiting response... 200 OK
Length: 94235922 (90M) [application/x-sh]
Saving to: ‘/tmp/tmp.O35iJIivKT/miniconda.sh’

/tmp/tmp.O35iJIivKT 100%[===================>]  89.87M  3.36MB/s    in 22s     

2021-01-20 09:09:59 (4.14 MB/s) - ‘/tmp/tmp.O35iJIivKT/miniconda.sh’ saved [94235922/94235922]


bash /tmp/tmp.O35iJIivKT/miniconda.sh -p /home/user/sct_dev/python -b -f

PREFIX=/home/user/sct_dev/python
Unpacking payload ...
Collecting package metadata (current_repodata.json): done                       
Solving environment: done

## Package Plan ##

  environment location: /home/user/sct_dev/python

  added / updated specs:
    - _libgcc_mutex==0.1=main
    - brotlipy==0.7.0=py38h27cfd23_1003
    - ca-certificates==2020.10.14=0
    - certifi==2020.6.20=pyhd3eb1b0_3
    - cffi==1.14.3=py38h261ae71_2
    - chardet==3.0.4=py38h06a4308_1003
    - conda-package-handling==1.7.2=py38h03888b9_0
    - conda==4.9.2=py38h06a4308_0
    - cryptography==3.2.1=py38h3c74f83_1
    - idna==2.10=py_0
    - ld_impl_linux-64==2.33.1=h53a641e_7
    - libedit==3.1.20191231=h14c3975_1
    - libffi==3.3=he6710b0_2
    - libgcc-ng==9.1.0=hdf63c60_0
    - libstdcxx-ng==9.1.0=hdf63c60_0
    - ncurses==6.2=he6710b0_1
    - openssl==1.1.1h=h7b6447c_0
    - pip==20.2.4=py38h06a4308_0
    - pycosat==0.6.3=py38h7b6447c_1
    - pycparser==2.20=py_2
    - pyopenssl==19.1.0=pyhd3eb1b0_1
    - pysocks==1.7.1=py38h06a4308_0
    - python==3.8.5=h7579374_1
    - readline==8.0=h7b6447c_0
    - requests==2.24.0=py_0
    - ruamel_yaml==0.15.87=py38h7b6447c_1
    - setuptools==50.3.1=py38h06a4308_1
    - six==1.15.0=py38h06a4308_0
    - sqlite==3.33.0=h62c20be_0
    - tk==8.6.10=hbc83047_0
    - tqdm==4.51.0=pyhd3eb1b0_0
    - urllib3==1.25.11=py_0
    - wheel==0.35.1=pyhd3eb1b0_0
    - xz==5.2.5=h7b6447c_0
    - yaml==0.2.5=h7b6447c_0
    - zlib==1.2.11=h7b6447c_3


The following NEW packages will be INSTALLED:

  _libgcc_mutex      pkgs/main/linux-64::_libgcc_mutex-0.1-main
  brotlipy           pkgs/main/linux-64::brotlipy-0.7.0-py38h27cfd23_1003
  ca-certificates    pkgs/main/linux-64::ca-certificates-2020.10.14-0
  certifi            pkgs/main/noarch::certifi-2020.6.20-pyhd3eb1b0_3
  cffi               pkgs/main/linux-64::cffi-1.14.3-py38h261ae71_2
  chardet            pkgs/main/linux-64::chardet-3.0.4-py38h06a4308_1003
  conda              pkgs/main/linux-64::conda-4.9.2-py38h06a4308_0
  conda-package-han~ pkgs/main/linux-64::conda-package-handling-1.7.2-py38h03888b9_0
  cryptography       pkgs/main/linux-64::cryptography-3.2.1-py38h3c74f83_1
  idna               pkgs/main/noarch::idna-2.10-py_0
  ld_impl_linux-64   pkgs/main/linux-64::ld_impl_linux-64-2.33.1-h53a641e_7
  libedit            pkgs/main/linux-64::libedit-3.1.20191231-h14c3975_1
  libffi             pkgs/main/linux-64::libffi-3.3-he6710b0_2
  libgcc-ng          pkgs/main/linux-64::libgcc-ng-9.1.0-hdf63c60_0
  libstdcxx-ng       pkgs/main/linux-64::libstdcxx-ng-9.1.0-hdf63c60_0
  ncurses            pkgs/main/linux-64::ncurses-6.2-he6710b0_1
  openssl            pkgs/main/linux-64::openssl-1.1.1h-h7b6447c_0
  pip                pkgs/main/linux-64::pip-20.2.4-py38h06a4308_0
  pycosat            pkgs/main/linux-64::pycosat-0.6.3-py38h7b6447c_1
  pycparser          pkgs/main/noarch::pycparser-2.20-py_2
  pyopenssl          pkgs/main/noarch::pyopenssl-19.1.0-pyhd3eb1b0_1
  pysocks            pkgs/main/linux-64::pysocks-1.7.1-py38h06a4308_0
  python             pkgs/main/linux-64::python-3.8.5-h7579374_1
  readline           pkgs/main/linux-64::readline-8.0-h7b6447c_0
  requests           pkgs/main/noarch::requests-2.24.0-py_0
  ruamel_yaml        pkgs/main/linux-64::ruamel_yaml-0.15.87-py38h7b6447c_1
  setuptools         pkgs/main/linux-64::setuptools-50.3.1-py38h06a4308_1
  six                pkgs/main/linux-64::six-1.15.0-py38h06a4308_0
  sqlite             pkgs/main/linux-64::sqlite-3.33.0-h62c20be_0
  tk                 pkgs/main/linux-64::tk-8.6.10-hbc83047_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/linux-64::xz-5.2.5-h7b6447c_0
  yaml               pkgs/main/linux-64::yaml-0.2.5-h7b6447c_0
  zlib               pkgs/main/linux-64::zlib-1.2.11-h7b6447c_3


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

## Package Plan ##

  environment location: /home/user/sct_dev/python/envs/venv_sct

  added / updated specs:
    - python=3.6


The following packages will be downloaded:

    package                    |            build
    ---------------------------|-----------------
    ca-certificates-2021.1.19  |       h06a4308_0         121 KB
    certifi-2020.12.5          |   py36h06a4308_0         140 KB
    openssl-1.1.1i             |       h27cfd23_0         2.5 MB
    pip-20.3.3                 |   py36h06a4308_0         1.8 MB
    python-3.6.12              |       hcff3b4d_2        29.7 MB
    setuptools-51.3.3          |   py36h06a4308_4         713 KB
    wheel-0.36.2               |     pyhd3eb1b0_0          33 KB
    ------------------------------------------------------------
                                           Total:        35.0 MB

The following NEW packages will be INSTALLED:

  _libgcc_mutex      pkgs/main/linux-64::_libgcc_mutex-0.1-main
  ca-certificates    pkgs/main/linux-64::ca-certificates-2021.1.19-h06a4308_0
  certifi            pkgs/main/linux-64::certifi-2020.12.5-py36h06a4308_0
  ld_impl_linux-64   pkgs/main/linux-64::ld_impl_linux-64-2.33.1-h53a641e_7
  libedit            pkgs/main/linux-64::libedit-3.1.20191231-h14c3975_1
  libffi             pkgs/main/linux-64::libffi-3.3-he6710b0_2
  libgcc-ng          pkgs/main/linux-64::libgcc-ng-9.1.0-hdf63c60_0
  libstdcxx-ng       pkgs/main/linux-64::libstdcxx-ng-9.1.0-hdf63c60_0
  ncurses            pkgs/main/linux-64::ncurses-6.2-he6710b0_1
  openssl            pkgs/main/linux-64::openssl-1.1.1i-h27cfd23_0
  pip                pkgs/main/linux-64::pip-20.3.3-py36h06a4308_0
  python             pkgs/main/linux-64::python-3.6.12-hcff3b4d_2
  readline           pkgs/main/linux-64::readline-8.0-h7b6447c_0
  setuptools         pkgs/main/linux-64::setuptools-51.3.3-py36h06a4308_4
  sqlite             pkgs/main/linux-64::sqlite-3.33.0-h62c20be_0
  tk                 pkgs/main/linux-64::tk-8.6.10-hbc83047_0
  wheel              pkgs/main/noarch::wheel-0.36.2-pyhd3eb1b0_0
  xz                 pkgs/main/linux-64::xz-5.2.5-h7b6447c_0
  zlib               pkgs/main/linux-64::zlib-1.2.11-h7b6447c_3



Downloading and Extracting Packages
setuptools-51.3.3    | 713 KB    | ##################################### | 100% 
python-3.6.12        | 29.7 MB   | ##################################### | 100% 
openssl-1.1.1i       | 2.5 MB    | ##################################### | 100% 
ca-certificates-2021 | 121 KB    | ##################################### | 100% 
certifi-2020.12.5    | 140 KB    | ##################################### | 100% 
pip-20.3.3           | 1.8 MB    | ##################################### | 100% 
wheel-0.36.2         | 33 KB     | ##################################### | 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


Installing Python dependencies...


Using requirements.txt (git installation)

Looking in links: https://download.pytorch.org/whl/cpu/torch_stable.html
Ignoring torch: markers 'sys_platform == "darwin"' don't match your environment
Ignoring torchvision: markers 'sys_platform == "darwin"' don't match your environment
Collecting ivadomed==2.6.1
  Downloading ivadomed-2.6.1-py3-none-any.whl (145 kB)
     |████████████████████████████████| 145 kB 235 kB/s 
Collecting h5py~=2.10.0
  Downloading h5py-2.10.0-cp36-cp36m-manylinux1_x86_64.whl (2.9 MB)
     |████████████████████████████████| 2.9 MB 47 kB/s 
Collecting Keras==2.1.5
  Downloading Keras-2.1.5-py2.py3-none-any.whl (334 kB)
     |████████████████████████████████| 334 kB 39 kB/s 
Collecting onnxruntime==1.4.0
  Downloading onnxruntime-1.4.0-cp36-cp36m-manylinux2010_x86_64.whl (4.4 MB)
     |████████████████████████████████| 4.4 MB 36 kB/s 
Collecting pyqt5==5.11.3
  Downloading PyQt5-5.11.3-5.11.2-cp35.cp36.cp37.cp38-abi3-manylinux1_x86_64.whl (117.8 MB)
     |████████████████████████████████| 117.8 MB 40 kB/s 
Collecting tensorboard==1.14.0
  Downloading tensorboard-1.14.0-py3-none-any.whl (3.1 MB)
     |████████████████████████████████| 3.1 MB 114 kB/s 
Requirement already satisfied: wheel>=0.26 in ./python/envs/venv_sct/lib/python3.6/site-packages (from tensorboard==1.14.0->-r requirements.txt (line 43)) (0.36.2)
Requirement already satisfied: setuptools>=41.0.0 in ./python/envs/venv_sct/lib/python3.6/site-packages (from tensorboard==1.14.0->-r requirements.txt (line 43)) (51.3.3.post20210118)
Collecting tensorflow==1.5.0
  Downloading tensorflow-1.5.0-cp36-cp36m-manylinux1_x86_64.whl (44.4 MB)
     |████████████████████████████████| 44.4 MB 67 kB/s 
WARNING: Retrying (Retry(total=4, connect=None, read=None, redirect=None, status=None)) after connection broken by 'NewConnectionError('<pip._vendor.urllib3.connection.HTTPSConnection object at 0x7fe056f410f0>: Failed to establish a new connection: [Errno 101] Network is unreachable',)': /whl/cpu/torch_stable.html
WARNING: Retrying (Retry(total=3, connect=None, read=None, redirect=None, status=None)) after connection broken by 'NewConnectionError('<pip._vendor.urllib3.connection.HTTPSConnection object at 0x7fe0566fd860>: Failed to establish a new connection: [Errno 101] Network is unreachable',)': /whl/cpu/torch_stable.html
WARNING: Retrying (Retry(total=2, connect=None, read=None, redirect=None, status=None)) after connection broken by 'NewConnectionError('<pip._vendor.urllib3.connection.HTTPSConnection object at 0x7fe0566fd908>: Failed to establish a new connection: [Errno 101] Network is unreachable',)': /whl/cpu/torch_stable.html
WARNING: Retrying (Retry(total=1, connect=None, read=None, redirect=None, status=None)) after connection broken by 'NewConnectionError('<pip._vendor.urllib3.connection.HTTPSConnection object at 0x7fe0566fdda0>: Failed to establish a new connection: [Errno 101] Network is unreachable',)': /whl/cpu/torch_stable.html
WARNING: Retrying (Retry(total=0, connect=None, read=None, redirect=None, status=None)) after connection broken by 'NewConnectionError('<pip._vendor.urllib3.connection.HTTPSConnection object at 0x7fe0566fda90>: Failed to establish a new connection: [Errno 101] Network is unreachable',)': /whl/cpu/torch_stable.html
Collecting torch==1.5.0+cpu
  WARNING: Retrying (Retry(total=4, connect=None, read=None, redirect=None, status=None)) after connection broken by 'NewConnectionError('<pip._vendor.urllib3.connection.HTTPSConnection object at 0x7fe0566f6d30>: Failed to establish a new connection: [Errno 101] Network is unreachable',)': /whl/cpu/torch-1.5.0%2Bcpu-cp36-cp36m-linux_x86_64.whl
  WARNING: Retrying (Retry(total=3, connect=None, read=None, redirect=None, status=None)) after connection broken by 'NewConnectionError('<pip._vendor.urllib3.connection.HTTPSConnection object at 0x7fe056708908>: Failed to establish a new connection: [Errno 101] Network is unreachable',)': /whl/cpu/torch-1.5.0%2Bcpu-cp36-cp36m-linux_x86_64.whl
  WARNING: Retrying (Retry(total=2, connect=None, read=None, redirect=None, status=None)) after connection broken by 'NewConnectionError('<pip._vendor.urllib3.connection.HTTPSConnection object at 0x7fe056708b38>: Failed to establish a new connection: [Errno 101] Network is unreachable',)': /whl/cpu/torch-1.5.0%2Bcpu-cp36-cp36m-linux_x86_64.whl
  WARNING: Retrying (Retry(total=1, connect=None, read=None, redirect=None, status=None)) after connection broken by 'NewConnectionError('<pip._vendor.urllib3.connection.HTTPSConnection object at 0x7fe056708438>: Failed to establish a new connection: [Errno 101] Network is unreachable',)': /whl/cpu/torch-1.5.0%2Bcpu-cp36-cp36m-linux_x86_64.whl
  WARNING: Retrying (Retry(total=0, connect=None, read=None, redirect=None, status=None)) after connection broken by 'NewConnectionError('<pip._vendor.urllib3.connection.HTTPSConnection object at 0x7fe056708cf8>: Failed to establish a new connection: [Errno 101] Network is unreachable',)': /whl/cpu/torch-1.5.0%2Bcpu-cp36-cp36m-linux_x86_64.whl
ERROR: Could not install packages due to an EnvironmentError: HTTPSConnectionPool(host='download.pytorch.org', port=443): Max retries exceeded with url: /whl/cpu/torch-1.5.0%2Bcpu-cp36-cp36m-linux_x86_64.whl (Caused by NewConnectionError('<pip._vendor.urllib3.connection.HTTPSConnection object at 0x7fe05668d278>: Failed to establish a new connection: [Errno 101] Network is unreachable',))


Failed running pip install: 1


Installation failed!

Please copy the output of this Terminal (starting with the command install_sct) and upload it as a .txt attachment in a new topic on SCT's forum:

Hi,
Thank you for reporting this issue. Just to let you know that we are currently working on it.
Best,
Julien

Hi @b_zeinali. Are you able to navigate to either of the following websites?

I have some ideas for how to fix your issue, but they depend on the answer to the above. :slightly_smiling_face:

Thank you kindly,
Joshua

Hi
yes, I can
Thank you for helping

Thank you! It seems there are some network issues that are preventing pip from connecting to the PyTorch website. I am not sure what the network issues are (there are many possible explanations)…

But, because you can access the links in your browser, I think you will be able to download the required packages manually instead. So, could you try downloading these 2 PyTorch files and move them inside the folder you had unzipped containing the SCT source files? (e.g. spinalcordtoolbox-5.0.1/)

Then, could you please edit your install_sct file to add this new line so that it is right underneath "Installing Python dependencies..."

# Install Python dependencies
print info "Installing Python dependencies..."
# NEW: Install pytorch wheels manually
pip install torch-1.5.0+cpu-cp36-cp36m-linux_x86_64.whl torchvision-0.6.0+cpu-cp36-cp36m-linux_x86_64.whl

This way, it will install the two manually downloaded packages before anything else gets installed. Then, after the script has been modified, please try reinstalling SCT.

Thank you kindly,
Joshua

I did that but it didn’t work. I also installed the files from this URL --> https://www.neuro.polymtl.ca/_media/downloads/sct/20200801_sct_binaries_linux.tar.gz
but it failed again. here is the error.
Should I add anything else to install_sct?

Trying URL: https://osf.io/cs6zt/?action=download
Retrying (Retry(total=2, connect=None, read=None, redirect=None, status=None)) after connection broken by ‘ProtocolError(‘Connection aborted.’, OSError(0, ‘Error’))’: /cs6zt/?action=download
Retrying (Retry(total=1, connect=None, read=None, redirect=None, status=None)) after connection broken by ‘ProtocolError(‘Connection aborted.’, OSError(0, ‘Error’))’: /cs6zt/?action=download
Retrying (Retry(total=0, connect=None, read=None, redirect=None, status=None)) after connection broken by ‘ProtocolError(‘Connection aborted.’, OSError(0, ‘Error’))’: /cs6zt/?action=download
Link download error, trying next mirror (error was: HTTPSConnectionPool(host=‘osf.io’, port=443): Max retries exceeded with url: /cs6zt/?action=download (Caused by ProtocolError(‘Connection aborted.’, OSError(0, ‘Error’))))
Trying URL: https://www.neuro.polymtl.ca/_media/downloads/sct/20200801_sct_binaries_linux.tar.gz
Link download error, trying next mirror (error was: 403 Client Error: Forbidden for url: https://www.neuro.polymtl.ca/_media/downloads/sct/20200801_sct_binaries_linux.tar.gz)
Traceback (most recent call last):
File “/home/user/sct_dev/spinalcordtoolbox/scripts/sct_download_data.py”, line 165, in
main(sys.argv[1:])
File “/home/user/sct_dev/spinalcordtoolbox/scripts/sct_download_data.py”, line 158, in main
install_data(url, dest_folder, keep=arguments.k)
File “/home/user/sct_dev/spinalcordtoolbox/download.py”, line 145, in install_data
tmp_file = download_data(url)
File “/home/user/sct_dev/spinalcordtoolbox/download.py”, line 81, in download_data
raise Exception(‘Download error’, exceptions)
Exception: (‘Download error’, [ConnectionError(MaxRetryError(“HTTPSConnectionPool(host=‘osf.io’, port=443): Max retries exceeded with url: /cs6zt/?action=download (Caused by ProtocolError(‘Connection aborted.’, OSError(0, ‘Error’)))”,),), HTTPError(‘403 Client Error: Forbidden for url: https://www.neuro.polymtl.ca/_media/downloads/sct/20200801_sct_binaries_linux.tar.gz’,)])

ERROR: Command failed.
Thanks

Thank you for the update. It looks like this wasn’t an issue with PyTorch specifically, then.

Given that you haven’t been able to access links for multiple different domains, my feeling is that this might not be a problem with SCT. So, I would say to try troubleshooting your connection via your personal internet settings. Some questions:

  • Are you using a VPN, proxy, or other tunneling service?
  • Do you use any network-wide services like firewalls, adblockers like PiHole, etc.?
  • Are you working from a connection that may restrict your access? (Work, school, public networks, etc.)
  • Does your internet service provider restrict your service in any way? (e.g. Region-based restrictions)
  • Have you modified any of the settings on your modem/router? (for example, DNS/DHCP settings.)

If you don’t make any progress here, then I can help to manually downloaded the necessary files. As a warning, though, doing that might be a bit time-consuming, so I think it would be preferable to address the connection issues. :slightly_smiling_face:

Best of luck,
Joshua

Hi @b_zeinali,

I just wanted to check in regarding your connection issues. Were you able to resolve them?

Kind regards,
Joshua

Dear Joshua Newton

Thank you for following up. Unfortunately, I could not solve it. I live in Iran, and as a result of limitations, I cannot access many sites without a VPN. I will be so appreciated if you can help me manually download and install the required programs. I am new to Ubuntu; therefore, installing programs is a little challenging for me.

Thank you so much

Best regards

Thank you so much for explaining your situation. I understand much better now, and would be happy to help. :slight_smile:


Some background information first

First I will explain what install_sct is trying to do, that way you can repeat it manually. The installation involves 4 main steps:

  1. Installing Python packages (SCT, as well as the code that SCT depends on)
  2. Downloading compiled binary files (in other words, non-Python code) to the bin/ folder
  3. Downloading large deep learning model files to the data/ folder.
  4. Editing a text file called the RC file to make sure the SCT commands are available to use inside a terminal.

Based on your posts, I believe you were able to complete step 1 and step 2 OK. However, step 3 is where install_sct failed. So, the goal will be to manually complete steps 3 and 4.

Step 3: Downloading “data/” files

Inside the SCT installation folder, there should be a subfolder called data/. (You may need to create it yourself.) Ideally, we want it to contain these model folders:

Each of these directories has been extracted from a .zip file, which is downloaded from a link. You can find the list of all of the links here: spinalcordtoolbox/sct_download_data.py at master · spinalcordtoolbox/spinalcordtoolbox · GitHub

So, if you are able to, you will want to try to access 9 links (for c2c3_disc_models, deepseg_gm_models, etc.), download 9 .zip files in total, then extract each of the .zip files so that your data/ folder matches the screenshot.

Step 4: Modifying your RC file

After this, you will want to edit a file on your system called an “RC file”.

First, we have to figure out which “RC file” to edit:

# run this command
ps -p $$

# example output
    PID TTY          TIME CMD
   8247 pts/1    00:00:00 bash
  • If it says bash, then edit the file “~/.bashrc
  • If it says zsh, then edit the file “~/.zshrc

Please open the file in a text editor. At the very bottom of the file, you will want to add 4 new lines. I added these 4 lines to my ~/.bashrc:

# SPINALCORDTOOLBOX
export PATH="/home/joshua/sct_5.3.0/bin:$PATH"
export SCT_DIR=/home/joshua/sct_5.3.0
export MPLBACKEND=Agg

In your case, the installation location is different. The output from your comment says:

SCT will be installed here: [/home/user/sct_dev]

So we want to use these lines instead:

# SPINALCORDTOOLBOX
export PATH="/home/user/sct_dev/bin:$PATH"
export SCT_DIR=/home/user/sct_dev
export MPLBACKEND=Agg

Then, you will want to save and close the windows.

Verifying the installation

Last, open a new terminal window, and type the following command to verify that everything went OK.

sct_check_dependencies

If everything went well, this will run some basic tests to check if everything got installed OK. This is what the output looks like for my installation: sct_check_dependencies_output.txt (3.2 KB)


I’m sorry about the trouble. Normally these steps would be done automatically for you, so I thank you for your patience. I hope these instructions work for you. :slightly_smiling_face:

Kind regards,
Joshua

1 Like

Thank you so much for your explanations. :pray: :pray: :pray:
Where should data folder exist? there was not data folder in /home/user/sct_dev/spinalcordtoolbox location. Therefore I created a new folder called data then I performed the steps.
However there was a failure in sct_check dependencies. Here is the output.

SCT info:

  • version: dev
  • path: /home/user/sct_dev
    OS: linux (Linux-5.4.0-47-generic-x86_64-with-debian-bullseye-sid)
    CPU cores: Available: 4, Used by ITK functions: 4
    RAM: Total: 3829MB, Used: 1114MB, Available: 2193MB
    Check Python executable…[OK]
    Using bundled python 3.6.12 |Anaconda, Inc.| (default, Sep 8 2020, 23:10:56)
    [GCC 7.3.0] at /home/user/sct_dev/python/envs/venv_sct/bin/python
    Check if data are installed…[FAIL]
    Check if colored is installed…[OK] (1.4.2)
    Check if dipy is installed…[OK] (1.3.0)
    Check if futures is installed…[OK]
    Check if h5py is installed…[OK] (2.10.0)
    Check if Keras (2.1.5) is installed…[OK] (2.1.5)
    Check if ivadomed (2.6.1) is installed…[OK] (2.6.1)
    Check if matplotlib is installed…[OK] (3.3.4)
    Check if nibabel is installed…[OK] (3.2.1)
    Check if numpy is installed…[OK] (1.19.5)
    Check if onnxruntime (1.4.0) is installed…[OK] (1.4.0)
    Check if pandas is installed…[OK] (1.1.5)
    Check if psutil is installed…[OK] (5.8.0)
    Check if pyqt5 (5.11.3) is installed…[OK] (5.11.3)
    Check if pytest is installed…[OK] (6.2.2)
    Check if pytest-cov is installed…[OK] (version = ‘2.11.1’)
    Check if raven is installed…[OK]
    Check if requests is installed…[OK] (2.25.1)
    Check if requirements-parser is installed…[OK] (0.2.0)
    Check if scipy is installed…[OK] (1.5.4)
    Check if scikit-image is installed…[OK] (0.17.2)
    Check if scikit-learn is installed…[OK] (0.24.1)
    Check if tensorflow (1.5.0) is installed…[OK] (1.5.0)
    Check if torch (1.5.0+cpu) is installed…[OK] (1.5.0+cpu)
    Check if torchvision (0.6.0+cpu) is installed…[OK] (0.6.0+cpu)
    Check if xlwt is installed…[OK] (1.3.0)
    Check if tqdm is installed…[OK] (4.56.2)
    Check if transforms3d is installed…[OK] (0.3.1)
    Check if urllib3 is installed…[OK] (1.26.3)
    Check if pytest_console_scripts is installed…[OK]
    Check if pytest-xdist is installed…[OK] (2.2.1)
    Check if tensorboard (1.14.0) is installed…[WARNING] (2.4.1 != 1.14.0 mandated version))
    Check if spinalcordtoolbox is installed…[OK]
    Check ANTs compatibility with OS …[OK]
    Check PropSeg compatibility with OS …[OK]
    Check if DISPLAY variable is set…[OK]
    Check if figure can be opened with PyQt…[OK]
    I appreciate your help
    Thanks a lot

Ah, my apologies, my instructions were unclear. Thank you for asking! In your case, I believe the data/ folder should be here:

/home/user/sct_dev/data/

Kind regards,
Joshua

There was no folder named “data” in /home/user/sct_dev/, however, I copied the data folder that I was created before in this path. Now everything is OK in sct_check dependencies as bellow:
spinal Cord Toolbox (dev)

sct_check_dependencies

SCT info:

  • version: dev
  • path: /home/user/sct_dev
    OS: linux (Linux-5.4.0-47-generic-x86_64-with-debian-bullseye-sid)
    CPU cores: Available: 4, Used by ITK functions: 4
    RAM: Total: 3829MB, Used: 1172MB, Available: 2172MB
    Check Python executable…[OK]
    Using bundled python 3.6.12 |Anaconda, Inc.| (default, Sep 8 2020, 23:10:56)
    [GCC 7.3.0] at /home/user/sct_dev/python/envs/venv_sct/bin/python
    Check if data are installed…[OK]
    Check if colored is installed…[OK] (1.4.2)
    Check if dipy is installed…[OK] (1.3.0)
    Check if futures is installed…[OK]
    Check if h5py is installed…[OK] (2.10.0)
    Check if Keras (2.1.5) is installed…[OK] (2.1.5)
    Check if ivadomed (2.6.1) is installed…[OK] (2.6.1)
    Check if matplotlib is installed…[OK] (3.3.4)
    Check if nibabel is installed…[OK] (3.2.1)
    Check if numpy is installed…[OK] (1.19.5)
    Check if onnxruntime (1.4.0) is installed…[OK] (1.4.0)
    Check if pandas is installed…[OK] (1.1.5)
    Check if psutil is installed…[OK] (5.8.0)
    Check if pyqt5 (5.11.3) is installed…[OK] (5.11.3)
    Check if pytest is installed…[OK] (6.2.2)
    Check if pytest-cov is installed…[OK] (version = ‘2.11.1’)
    Check if raven is installed…[OK]
    Check if requests is installed…[OK] (2.25.1)
    Check if requirements-parser is installed…[OK] (0.2.0)
    Check if scipy is installed…[OK] (1.5.4)
    Check if scikit-image is installed…[OK] (0.17.2)
    Check if scikit-learn is installed…[OK] (0.24.1)
    Check if tensorflow (1.5.0) is installed…[OK] (1.5.0)
    Check if torch (1.5.0+cpu) is installed…[OK] (1.5.0+cpu)
    Check if torchvision (0.6.0+cpu) is installed…[OK] (0.6.0+cpu)
    Check if xlwt is installed…[OK] (1.3.0)
    Check if tqdm is installed…[OK] (4.56.2)
    Check if transforms3d is installed…[OK] (0.3.1)
    Check if urllib3 is installed…[OK] (1.26.3)
    Check if pytest_console_scripts is installed…[OK]
    Check if pytest-xdist is installed…[OK] (2.2.1)
    Check if tensorboard (1.14.0) is installed…[WARNING] (2.4.1 != 1.14.0 mandated version))
    Check if spinalcordtoolbox is installed…[OK]
    Check ANTs compatibility with OS …[OK]
    Check PropSeg compatibility with OS …[OK]
    Check if DISPLAY variable is set…[OK]
    Check if figure can be opened with PyQt…[OK]
    Now is the installation over or I there are more steps that I should do?
    I am sincerely thankful for your help

I think that your installation should be ready for use now. :slight_smile:

If you would like, though, there is one more check you can run to verify the installation. If you run the command “sct_testing”, it will test each of the commands using real-world images and verify their results. Here is what the output looks like for me: sct_testing_output.txt (4.6 KB)

This command relies on downloading more external data (test images). So, connection issues may interfere again.

Kind regards,
Joshua

Hi @b_zeinali, just checking if the post above solved your issue?

Oh, yes, thank you so much. My apology, I should have replied to the previous post. I should also thank engineer Newton, who helped me a lot patiently. Finally thanks a lot for the useful and practical software.

2 Likes

Dear Joshuacwnewton, I’ve also been dealing with the same problem.
I downloaded all the files from the link you provided. But I can not go through Step4. There isn’t any folder named “data” inside the installation directory. Also when I run the gedit ~/.bshrc command, at the very bottom of the script, the codes already written are not alike the ones you have shown. Therefore I am not sure If I’m putting the codes you have provided in the right place or not.

Hi @ali.mi! Happy to help.

It would be most helpful if you could share the full output of the installation so I could see exactly where the installation fails.

Could you please try making this folder yourself?

(install_sct could have gotten stopped before data/ could be created)

Could you please look at this comment again? I have made some edits, which will hopefully make the instructions a bit more clear. Please let me know if you still have questions or concerns. :slightly_smiling_face:

Solved. thank you so much.

1 Like