SCT 5.8 installation error on Windows 11

Dear SCT team,

I am trying to install SCT 5.8 on Windows 11 using the installer install_sct-5.8_win.bat, and keep running into an error saying “ModuleNotFoundError: No module named ‘packaging’”. Here is the output from the terminal:

Virtual environment created and activated successfully

### Installing SCT and its dependencies from requirements-freeze.txt ...
Requirement already satisfied: pip in c:\users\ryanx\spinalcordtoolbox\venv_sct\lib\site-packages (22.3.1)
Collecting pip
  Using cached pip-23.1.2-py3-none-any.whl (2.1 MB)
Installing collected packages: pip
  Attempting uninstall: pip
    Found existing installation: pip 22.3.1
    Uninstalling pip-22.3.1:
      Successfully uninstalled pip-22.3.1
Successfully installed pip-23.1.2
Looking in indexes: https://pypi.org/simple, https://download.pytorch.org/whl/cpu
Collecting absl-py==1.3.0 (from -r requirements-freeze.txt (line 1))
  Using cached absl_py-1.3.0-py3-none-any.whl (124 kB)
Collecting astor==0.8.1 (from -r requirements-freeze.txt (line 2))
  Using cached astor-0.8.1-py2.py3-none-any.whl (27 kB)
Collecting attrs==22.1.0 (from -r requirements-freeze.txt (line 3))
  Using cached attrs-22.1.0-py2.py3-none-any.whl (58 kB)
Collecting bids-validator==1.9.9 (from -r requirements-freeze.txt (line 4))
  Using cached bids_validator-1.9.9-py2.py3-none-any.whl (21 kB)
Collecting cachetools==5.2.0 (from -r requirements-freeze.txt (line 5))
  Using cached cachetools-5.2.0-py3-none-any.whl (9.3 kB)
Collecting certifi==2022.9.24 (from -r requirements-freeze.txt (line 6))
  Using cached certifi-2022.9.24-py3-none-any.whl (161 kB)
Collecting cffi==1.15.1 (from -r requirements-freeze.txt (line 7))
  Using cached cffi-1.15.1-cp311-cp311-win_amd64.whl (179 kB)
Collecting charset-normalizer==2.1.1 (from -r requirements-freeze.txt (line 8))
  Using cached https://download.pytorch.org/whl/charset_normalizer-2.1.1-py3-none-any.whl (39 kB)
Collecting click==8.1.3 (from -r requirements-freeze.txt (line 9))
  Using cached click-8.1.3-py3-none-any.whl (96 kB)
Collecting colorama==0.4.6 (from -r requirements-freeze.txt (line 10))
  Using cached https://download.pytorch.org/whl/colorama-0.4.6-py2.py3-none-any.whl (25 kB)
Collecting coloredlogs==15.0.1 (from -r requirements-freeze.txt (line 11))
  Using cached coloredlogs-15.0.1-py2.py3-none-any.whl (46 kB)
Collecting commonmark==0.9.1 (from -r requirements-freeze.txt (line 12))
  Using cached commonmark-0.9.1-py2.py3-none-any.whl (51 kB)
Collecting contourpy==1.0.6 (from -r requirements-freeze.txt (line 13))
  Using cached contourpy-1.0.6-cp311-cp311-win_amd64.whl (163 kB)
Collecting coverage==6.5.0 (from -r requirements-freeze.txt (line 14))
  Using cached coverage-6.5.0-cp311-cp311-win_amd64.whl (188 kB)
Collecting cryptography==38.0.4 (from -r requirements-freeze.txt (line 15))
  Using cached cryptography-38.0.4-cp36-abi3-win_amd64.whl (2.4 MB)
Collecting csv-diff==1.1 (from -r requirements-freeze.txt (line 16))
  Using cached csv_diff-1.1-py3-none-any.whl (12 kB)
Collecting cycler==0.11.0 (from -r requirements-freeze.txt (line 17))
  Using cached cycler-0.11.0-py3-none-any.whl (6.4 kB)
Collecting Deprecated==1.2.13 (from -r requirements-freeze.txt (line 18))
  Using cached Deprecated-1.2.13-py2.py3-none-any.whl (9.6 kB)
Collecting dictdiffer==0.9.0 (from -r requirements-freeze.txt (line 19))
  Using cached dictdiffer-0.9.0-py2.py3-none-any.whl (16 kB)
Collecting dipy==1.5.0 (from -r requirements-freeze.txt (line 20))
  Using cached dipy-1.5.0.tar.gz (11.8 MB)
  Installing build dependencies ... done
  Getting requirements to build wheel ... error
  error: subprocess-exited-with-error

  × Getting requirements to build wheel did not run successfully.
  │ exit code: 1
  ╰─> [23 lines of output]
      Traceback (most recent call last):
        File "C:\Users\ryanx\spinalcordtoolbox\venv_sct\Lib\site-packages\pip\_vendor\pyproject_hooks\_in_process\_in_process.py", line 353, in <module>
          main()
        File "C:\Users\ryanx\spinalcordtoolbox\venv_sct\Lib\site-packages\pip\_vendor\pyproject_hooks\_in_process\_in_process.py", line 335, in main
          json_out['return_val'] = hook(**hook_input['kwargs'])
                                   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
        File "C:\Users\ryanx\spinalcordtoolbox\venv_sct\Lib\site-packages\pip\_vendor\pyproject_hooks\_in_process\_in_process.py", line 118, in get_requires_for_build_wheel
          return hook(config_settings)
                 ^^^^^^^^^^^^^^^^^^^^^
        File "C:\Users\ryanx\AppData\Local\Temp\pip-build-env-lzut6jt0\overlay\Lib\site-packages\setuptools\build_meta.py", line 341, in get_requires_for_build_wheel
          return self._get_build_requires(config_settings, requirements=['wheel'])
                 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
        File "C:\Users\ryanx\AppData\Local\Temp\pip-build-env-lzut6jt0\overlay\Lib\site-packages\setuptools\build_meta.py", line 323, in _get_build_requires
          self.run_setup()
        File "C:\Users\ryanx\AppData\Local\Temp\pip-build-env-lzut6jt0\overlay\Lib\site-packages\setuptools\build_meta.py", line 488, in run_setup
          self).run_setup(setup_script=setup_script)
                ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
        File "C:\Users\ryanx\AppData\Local\Temp\pip-build-env-lzut6jt0\overlay\Lib\site-packages\setuptools\build_meta.py", line 338, in run_setup
          exec(code, locals())
        File "<string>", line 34, in <module>
        File "C:\Users\ryanx\AppData\Local\Temp\pip-install-t5bq3tll\dipy_8f6233f19d3b4dbeaa53c447f2ae4462\cythexts.py", line 7, in <module>
          from packaging.version import Version
      ModuleNotFoundError: No module named 'packaging'
      [end of output]

  note: This error originates from a subprocess, and is likely not a problem with pip.
error: subprocess-exited-with-error

× Getting requirements to build wheel did not run successfully.
│ exit code: 1
╰─> See above for output.

note: This error originates from a subprocess, and is likely not a problem with pip.
Failed with error #1.

I would appreciate any help.

As a quick note, SCT will be improving its installation procedures in version 6.0, which I believe will resolve issues like this in the future. But, for now, I am happy to help get version 5.8 working for you. :slight_smile:

Thank you for reporting this issue, @ryan_x!

Could you please try opening a Terminal window, then running the following commands, and sharing the output?

pip cache list
pip cache remove dipy*

Then, after running these commands, could you please try re-running the SCT v5.8 installer, and let me know how it goes?

Thank you kindly,
Joshua

Thank you for the suggestion!

The output of the commands are as follows:

C:\Users\ryanx>pip cache list
No locally built wheels cached.

C:\Users\ryanx>pip cache remove dipy*
WARNING: No matching packages for pattern "dipy*"
Files removed: 0

And the problem persists after re-running the installer:

### Previous spinalcordtoolbox installation found at \Users\ryanx\spinalcordtoolbox.
### Continuing will overwrite the existing installation directory spinalcordtoolbox\, Are you sure (Y/N)? y
Virtual environment created and activated successfully

### Installing SCT and its dependencies from requirements-freeze.txt ...
Requirement already satisfied: pip in c:\users\ryanx\spinalcordtoolbox\venv_sct\lib\site-packages (22.3.1)
Collecting pip
  Using cached pip-23.1.2-py3-none-any.whl (2.1 MB)
Installing collected packages: pip
  Attempting uninstall: pip
    Found existing installation: pip 22.3.1
    Uninstalling pip-22.3.1:
      Successfully uninstalled pip-22.3.1
Successfully installed pip-23.1.2
Looking in indexes: https://pypi.org/simple, https://download.pytorch.org/whl/cpu
Collecting absl-py==1.3.0 (from -r requirements-freeze.txt (line 1))
  Using cached absl_py-1.3.0-py3-none-any.whl (124 kB)
Collecting astor==0.8.1 (from -r requirements-freeze.txt (line 2))
  Using cached astor-0.8.1-py2.py3-none-any.whl (27 kB)
Collecting attrs==22.1.0 (from -r requirements-freeze.txt (line 3))
  Using cached attrs-22.1.0-py2.py3-none-any.whl (58 kB)
Collecting bids-validator==1.9.9 (from -r requirements-freeze.txt (line 4))
  Using cached bids_validator-1.9.9-py2.py3-none-any.whl (21 kB)
Collecting cachetools==5.2.0 (from -r requirements-freeze.txt (line 5))
  Using cached cachetools-5.2.0-py3-none-any.whl (9.3 kB)
Collecting certifi==2022.9.24 (from -r requirements-freeze.txt (line 6))
  Using cached certifi-2022.9.24-py3-none-any.whl (161 kB)
Collecting cffi==1.15.1 (from -r requirements-freeze.txt (line 7))
  Using cached cffi-1.15.1-cp311-cp311-win_amd64.whl (179 kB)
Collecting charset-normalizer==2.1.1 (from -r requirements-freeze.txt (line 8))
  Using cached https://download.pytorch.org/whl/charset_normalizer-2.1.1-py3-none-any.whl (39 kB)
Collecting click==8.1.3 (from -r requirements-freeze.txt (line 9))
  Using cached click-8.1.3-py3-none-any.whl (96 kB)
Collecting colorama==0.4.6 (from -r requirements-freeze.txt (line 10))
  Using cached https://download.pytorch.org/whl/colorama-0.4.6-py2.py3-none-any.whl (25 kB)
Collecting coloredlogs==15.0.1 (from -r requirements-freeze.txt (line 11))
  Using cached coloredlogs-15.0.1-py2.py3-none-any.whl (46 kB)
Collecting commonmark==0.9.1 (from -r requirements-freeze.txt (line 12))
  Using cached commonmark-0.9.1-py2.py3-none-any.whl (51 kB)
Collecting contourpy==1.0.6 (from -r requirements-freeze.txt (line 13))
  Using cached contourpy-1.0.6-cp311-cp311-win_amd64.whl (163 kB)
Collecting coverage==6.5.0 (from -r requirements-freeze.txt (line 14))
  Using cached coverage-6.5.0-cp311-cp311-win_amd64.whl (188 kB)
Collecting cryptography==38.0.4 (from -r requirements-freeze.txt (line 15))
  Using cached cryptography-38.0.4-cp36-abi3-win_amd64.whl (2.4 MB)
Collecting csv-diff==1.1 (from -r requirements-freeze.txt (line 16))
  Using cached csv_diff-1.1-py3-none-any.whl (12 kB)
Collecting cycler==0.11.0 (from -r requirements-freeze.txt (line 17))
  Using cached cycler-0.11.0-py3-none-any.whl (6.4 kB)
Collecting Deprecated==1.2.13 (from -r requirements-freeze.txt (line 18))
  Using cached Deprecated-1.2.13-py2.py3-none-any.whl (9.6 kB)
Collecting dictdiffer==0.9.0 (from -r requirements-freeze.txt (line 19))
  Using cached dictdiffer-0.9.0-py2.py3-none-any.whl (16 kB)
Collecting dipy==1.5.0 (from -r requirements-freeze.txt (line 20))
  Using cached dipy-1.5.0.tar.gz (11.8 MB)
  Installing build dependencies ... done
  Getting requirements to build wheel ... error
  error: subprocess-exited-with-error

  × Getting requirements to build wheel did not run successfully.
  │ exit code: 1
  ╰─> [23 lines of output]
      Traceback (most recent call last):
        File "C:\Users\ryanx\spinalcordtoolbox\venv_sct\Lib\site-packages\pip\_vendor\pyproject_hooks\_in_process\_in_process.py", line 353, in <module>
          main()
        File "C:\Users\ryanx\spinalcordtoolbox\venv_sct\Lib\site-packages\pip\_vendor\pyproject_hooks\_in_process\_in_process.py", line 335, in main
          json_out['return_val'] = hook(**hook_input['kwargs'])
                                   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
        File "C:\Users\ryanx\spinalcordtoolbox\venv_sct\Lib\site-packages\pip\_vendor\pyproject_hooks\_in_process\_in_process.py", line 118, in get_requires_for_build_wheel
          return hook(config_settings)
                 ^^^^^^^^^^^^^^^^^^^^^
        File "C:\Users\ryanx\AppData\Local\Temp\pip-build-env-9p2w4_ux\overlay\Lib\site-packages\setuptools\build_meta.py", line 341, in get_requires_for_build_wheel
          return self._get_build_requires(config_settings, requirements=['wheel'])
                 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
        File "C:\Users\ryanx\AppData\Local\Temp\pip-build-env-9p2w4_ux\overlay\Lib\site-packages\setuptools\build_meta.py", line 323, in _get_build_requires
          self.run_setup()
        File "C:\Users\ryanx\AppData\Local\Temp\pip-build-env-9p2w4_ux\overlay\Lib\site-packages\setuptools\build_meta.py", line 488, in run_setup
          self).run_setup(setup_script=setup_script)
                ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
        File "C:\Users\ryanx\AppData\Local\Temp\pip-build-env-9p2w4_ux\overlay\Lib\site-packages\setuptools\build_meta.py", line 338, in run_setup
          exec(code, locals())
        File "<string>", line 34, in <module>
        File "C:\Users\ryanx\AppData\Local\Temp\pip-install-a8kiz2_a\dipy_e48a60c8b52e4f4396b824963c7e3758\cythexts.py", line 7, in <module>
          from packaging.version import Version
      ModuleNotFoundError: No module named 'packaging'
      [end of output]

  note: This error originates from a subprocess, and is likely not a problem with pip.
error: subprocess-exited-with-error

× Getting requirements to build wheel did not run successfully.
│ exit code: 1
╰─> See above for output.

note: This error originates from a subprocess, and is likely not a problem with pip.
Failed with error #1.

Hi @ryan_x,

My apologies that the suggestion did not work.

Could you please try using this modified copy of install_sct.bat:

install_sct-5.8_win_updated.bat (5.2 KB)

For transparency, I have made the following change:

# Before
pip install -r %requirements_file%
# After
pip install -r %requirements_file% --no-cache-dir

The reason for this change is to try to avoid using the cached copy of dipy, which is mentioned in your error log:

Collecting dipy==1.5.0 (from -r requirements-freeze.txt (line 20))
  Using cached dipy-1.5.0.tar.gz (11.8 MB)

Please let me know whether this updated file works for you. :slight_smile:

Kind regards,
Joshua

Many thanks! Unfortunately, I got the same error with the modified installer. :slightly_frowning_face:

Virtual environment created and activated successfully

### Installing SCT and its dependencies from requirements-freeze.txt ...
Requirement already satisfied: pip in c:\users\ryanx\spinalcordtoolbox\venv_sct\lib\site-packages (22.3.1)
Collecting pip
  Using cached pip-23.1.2-py3-none-any.whl (2.1 MB)
Installing collected packages: pip
  Attempting uninstall: pip
    Found existing installation: pip 22.3.1
    Uninstalling pip-22.3.1:
      Successfully uninstalled pip-22.3.1
Successfully installed pip-23.1.2
Looking in indexes: https://pypi.org/simple, https://download.pytorch.org/whl/cpu
Collecting absl-py==1.3.0 (from -r requirements-freeze.txt (line 1))
  Downloading absl_py-1.3.0-py3-none-any.whl (124 kB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 124.6/124.6 kB 486.6 kB/s eta 0:00:00
Collecting astor==0.8.1 (from -r requirements-freeze.txt (line 2))
  Downloading astor-0.8.1-py2.py3-none-any.whl (27 kB)
Collecting attrs==22.1.0 (from -r requirements-freeze.txt (line 3))
  Downloading attrs-22.1.0-py2.py3-none-any.whl (58 kB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 58.8/58.8 kB 3.0 MB/s eta 0:00:00
Collecting bids-validator==1.9.9 (from -r requirements-freeze.txt (line 4))
  Downloading bids_validator-1.9.9-py2.py3-none-any.whl (21 kB)
Collecting cachetools==5.2.0 (from -r requirements-freeze.txt (line 5))
  Downloading cachetools-5.2.0-py3-none-any.whl (9.3 kB)
Collecting certifi==2022.9.24 (from -r requirements-freeze.txt (line 6))
  Downloading certifi-2022.9.24-py3-none-any.whl (161 kB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 161.1/161.1 kB 967.2 kB/s eta 0:00:00
Collecting cffi==1.15.1 (from -r requirements-freeze.txt (line 7))
  Downloading cffi-1.15.1-cp311-cp311-win_amd64.whl (179 kB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 179.0/179.0 kB 3.6 MB/s eta 0:00:00
Collecting charset-normalizer==2.1.1 (from -r requirements-freeze.txt (line 8))
  Downloading https://download.pytorch.org/whl/charset_normalizer-2.1.1-py3-none-any.whl (39 kB)
Collecting click==8.1.3 (from -r requirements-freeze.txt (line 9))
  Downloading click-8.1.3-py3-none-any.whl (96 kB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 96.6/96.6 kB 172.7 kB/s eta 0:00:00
Collecting colorama==0.4.6 (from -r requirements-freeze.txt (line 10))
  Downloading https://download.pytorch.org/whl/colorama-0.4.6-py2.py3-none-any.whl (25 kB)
Collecting coloredlogs==15.0.1 (from -r requirements-freeze.txt (line 11))
  Downloading coloredlogs-15.0.1-py2.py3-none-any.whl (46 kB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 46.0/46.0 kB 1.2 MB/s eta 0:00:00
Collecting commonmark==0.9.1 (from -r requirements-freeze.txt (line 12))
  Downloading commonmark-0.9.1-py2.py3-none-any.whl (51 kB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 51.1/51.1 kB 1.3 MB/s eta 0:00:00
Collecting contourpy==1.0.6 (from -r requirements-freeze.txt (line 13))
  Downloading contourpy-1.0.6-cp311-cp311-win_amd64.whl (163 kB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 163.6/163.6 kB 1.9 MB/s eta 0:00:00
Collecting coverage==6.5.0 (from -r requirements-freeze.txt (line 14))
  Downloading coverage-6.5.0-cp311-cp311-win_amd64.whl (188 kB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 188.6/188.6 kB 1.9 MB/s eta 0:00:00
Collecting cryptography==38.0.4 (from -r requirements-freeze.txt (line 15))
  Downloading cryptography-38.0.4-cp36-abi3-win_amd64.whl (2.4 MB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 2.4/2.4 MB 1.8 MB/s eta 0:00:00
Collecting csv-diff==1.1 (from -r requirements-freeze.txt (line 16))
  Downloading csv_diff-1.1-py3-none-any.whl (12 kB)
Collecting cycler==0.11.0 (from -r requirements-freeze.txt (line 17))
  Downloading cycler-0.11.0-py3-none-any.whl (6.4 kB)
Collecting Deprecated==1.2.13 (from -r requirements-freeze.txt (line 18))
  Downloading Deprecated-1.2.13-py2.py3-none-any.whl (9.6 kB)
Collecting dictdiffer==0.9.0 (from -r requirements-freeze.txt (line 19))
  Downloading dictdiffer-0.9.0-py2.py3-none-any.whl (16 kB)
Collecting dipy==1.5.0 (from -r requirements-freeze.txt (line 20))
  Downloading dipy-1.5.0.tar.gz (11.8 MB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 11.8/11.8 MB 1.7 MB/s eta 0:00:00
  Installing build dependencies ... done
  Getting requirements to build wheel ... error
  error: subprocess-exited-with-error

  × Getting requirements to build wheel did not run successfully.
  │ exit code: 1
  ╰─> [23 lines of output]
      Traceback (most recent call last):
        File "C:\Users\ryanx\spinalcordtoolbox\venv_sct\Lib\site-packages\pip\_vendor\pyproject_hooks\_in_process\_in_process.py", line 353, in <module>
          main()
        File "C:\Users\ryanx\spinalcordtoolbox\venv_sct\Lib\site-packages\pip\_vendor\pyproject_hooks\_in_process\_in_process.py", line 335, in main
          json_out['return_val'] = hook(**hook_input['kwargs'])
                                   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
        File "C:\Users\ryanx\spinalcordtoolbox\venv_sct\Lib\site-packages\pip\_vendor\pyproject_hooks\_in_process\_in_process.py", line 118, in get_requires_for_build_wheel
          return hook(config_settings)
                 ^^^^^^^^^^^^^^^^^^^^^
        File "C:\Users\ryanx\AppData\Local\Temp\pip-build-env-vwmvalv2\overlay\Lib\site-packages\setuptools\build_meta.py", line 341, in get_requires_for_build_wheel
          return self._get_build_requires(config_settings, requirements=['wheel'])
                 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
        File "C:\Users\ryanx\AppData\Local\Temp\pip-build-env-vwmvalv2\overlay\Lib\site-packages\setuptools\build_meta.py", line 323, in _get_build_requires
          self.run_setup()
        File "C:\Users\ryanx\AppData\Local\Temp\pip-build-env-vwmvalv2\overlay\Lib\site-packages\setuptools\build_meta.py", line 488, in run_setup
          self).run_setup(setup_script=setup_script)
                ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
        File "C:\Users\ryanx\AppData\Local\Temp\pip-build-env-vwmvalv2\overlay\Lib\site-packages\setuptools\build_meta.py", line 338, in run_setup
          exec(code, locals())
        File "<string>", line 34, in <module>
        File "C:\Users\ryanx\AppData\Local\Temp\pip-install-435ss32c\dipy_0c424bdcd2d945678dba17fc41b43be3\cythexts.py", line 7, in <module>
          from packaging.version import Version
      ModuleNotFoundError: No module named 'packaging'
      [end of output]

  note: This error originates from a subprocess, and is likely not a problem with pip.
error: subprocess-exited-with-error

× Getting requirements to build wheel did not run successfully.
│ exit code: 1
╰─> See above for output.

note: This error originates from a subprocess, and is likely not a problem with pip.
Failed with error #1.

Hi @ryan_x,

Hmm. That’s very strange!

When I use the install script on my own personal Windows 11 machine, I instead see:

# Mine (wheel)
Downloading dipy-1.5.0-cp38-none-win_amd64.whl (7.4 MB)

# Yours (source distribution)
Downloading dipy-1.5.0.tar.gz (11.8 MB)

I was hoping by avoiding the cache, your installation would fetch the wheel, thus avoiding the error. But, instead the source distribution (.tar.gz) is still downloaded. :thinking:


Nonetheless, I can offer a short-term solution while I dig into the root problem here:

install_sct-5.8_win_updated_2.bat (5.3 KB)

The line I’ve added this time is:

pip install packaging

This should hopefully resolve the missing dependency error that you’ve been getting:

      ModuleNotFoundError: No module named 'packaging'

Kind regards,
Joshua

Thanks Joshua, but here it goes again:

### Previous spinalcordtoolbox installation found at \Users\ryanx\spinalcordtoolbox.
### Continuing will overwrite the existing installation directory spinalcordtoolbox\, Are you sure (Y/N)? y
Virtual environment created and activated successfully

### Installing SCT and its dependencies from requirements-freeze.txt ...
Requirement already satisfied: pip in c:\users\ryanx\spinalcordtoolbox\venv_sct\lib\site-packages (22.3.1)
Collecting pip
  Using cached pip-23.1.2-py3-none-any.whl (2.1 MB)
Installing collected packages: pip
  Attempting uninstall: pip
    Found existing installation: pip 22.3.1
    Uninstalling pip-22.3.1:
      Successfully uninstalled pip-22.3.1
Successfully installed pip-23.1.2
Collecting packaging
  Downloading packaging-23.1-py3-none-any.whl (48 kB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 48.9/48.9 kB 1.2 MB/s eta 0:00:00
Installing collected packages: packaging
Successfully installed packaging-23.1
Looking in indexes: https://pypi.org/simple, https://download.pytorch.org/whl/cpu
Collecting absl-py==1.3.0 (from -r requirements-freeze.txt (line 1))
  Downloading absl_py-1.3.0-py3-none-any.whl (124 kB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 124.6/124.6 kB 1.5 MB/s eta 0:00:00
Collecting astor==0.8.1 (from -r requirements-freeze.txt (line 2))
  Downloading astor-0.8.1-py2.py3-none-any.whl (27 kB)
Collecting attrs==22.1.0 (from -r requirements-freeze.txt (line 3))
  Downloading attrs-22.1.0-py2.py3-none-any.whl (58 kB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 58.8/58.8 kB 1.0 MB/s eta 0:00:00
Collecting bids-validator==1.9.9 (from -r requirements-freeze.txt (line 4))
  Downloading bids_validator-1.9.9-py2.py3-none-any.whl (21 kB)
Collecting cachetools==5.2.0 (from -r requirements-freeze.txt (line 5))
  Downloading cachetools-5.2.0-py3-none-any.whl (9.3 kB)
Collecting certifi==2022.9.24 (from -r requirements-freeze.txt (line 6))
  Downloading certifi-2022.9.24-py3-none-any.whl (161 kB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 161.1/161.1 kB 1.6 MB/s eta 0:00:00
Collecting cffi==1.15.1 (from -r requirements-freeze.txt (line 7))
  Downloading cffi-1.15.1-cp311-cp311-win_amd64.whl (179 kB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 179.0/179.0 kB 1.8 MB/s eta 0:00:00
Collecting charset-normalizer==2.1.1 (from -r requirements-freeze.txt (line 8))
  Downloading https://download.pytorch.org/whl/charset_normalizer-2.1.1-py3-none-any.whl (39 kB)
Collecting click==8.1.3 (from -r requirements-freeze.txt (line 9))
  Downloading click-8.1.3-py3-none-any.whl (96 kB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 96.6/96.6 kB 918.6 kB/s eta 0:00:00
Collecting colorama==0.4.6 (from -r requirements-freeze.txt (line 10))
  Downloading https://download.pytorch.org/whl/colorama-0.4.6-py2.py3-none-any.whl (25 kB)
Collecting coloredlogs==15.0.1 (from -r requirements-freeze.txt (line 11))
  Downloading coloredlogs-15.0.1-py2.py3-none-any.whl (46 kB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 46.0/46.0 kB 777.8 kB/s eta 0:00:00
Collecting commonmark==0.9.1 (from -r requirements-freeze.txt (line 12))
  Downloading commonmark-0.9.1-py2.py3-none-any.whl (51 kB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 51.1/51.1 kB 868.7 kB/s eta 0:00:00
Collecting contourpy==1.0.6 (from -r requirements-freeze.txt (line 13))
  Downloading contourpy-1.0.6-cp311-cp311-win_amd64.whl (163 kB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 163.6/163.6 kB 1.6 MB/s eta 0:00:00
Collecting coverage==6.5.0 (from -r requirements-freeze.txt (line 14))
  Downloading coverage-6.5.0-cp311-cp311-win_amd64.whl (188 kB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 188.6/188.6 kB 1.9 MB/s eta 0:00:00
Collecting cryptography==38.0.4 (from -r requirements-freeze.txt (line 15))
  Downloading cryptography-38.0.4-cp36-abi3-win_amd64.whl (2.4 MB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 2.4/2.4 MB 4.4 MB/s eta 0:00:00
Collecting csv-diff==1.1 (from -r requirements-freeze.txt (line 16))
  Downloading csv_diff-1.1-py3-none-any.whl (12 kB)
Collecting cycler==0.11.0 (from -r requirements-freeze.txt (line 17))
  Downloading cycler-0.11.0-py3-none-any.whl (6.4 kB)
Collecting Deprecated==1.2.13 (from -r requirements-freeze.txt (line 18))
  Downloading Deprecated-1.2.13-py2.py3-none-any.whl (9.6 kB)
Collecting dictdiffer==0.9.0 (from -r requirements-freeze.txt (line 19))
  Downloading dictdiffer-0.9.0-py2.py3-none-any.whl (16 kB)
Collecting dipy==1.5.0 (from -r requirements-freeze.txt (line 20))
  Downloading dipy-1.5.0.tar.gz (11.8 MB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 11.8/11.8 MB 10.4 MB/s eta 0:00:00
  Installing build dependencies ... done
  Getting requirements to build wheel ... error
  error: subprocess-exited-with-error

  × Getting requirements to build wheel did not run successfully.
  │ exit code: 1
  ╰─> [23 lines of output]
      Traceback (most recent call last):
        File "C:\Users\ryanx\spinalcordtoolbox\venv_sct\Lib\site-packages\pip\_vendor\pyproject_hooks\_in_process\_in_process.py", line 353, in <module>
          main()
        File "C:\Users\ryanx\spinalcordtoolbox\venv_sct\Lib\site-packages\pip\_vendor\pyproject_hooks\_in_process\_in_process.py", line 335, in main
          json_out['return_val'] = hook(**hook_input['kwargs'])
                                   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
        File "C:\Users\ryanx\spinalcordtoolbox\venv_sct\Lib\site-packages\pip\_vendor\pyproject_hooks\_in_process\_in_process.py", line 118, in get_requires_for_build_wheel
          return hook(config_settings)
                 ^^^^^^^^^^^^^^^^^^^^^
        File "C:\Users\ryanx\AppData\Local\Temp\pip-build-env-oibpm6st\overlay\Lib\site-packages\setuptools\build_meta.py", line 341, in get_requires_for_build_wheel
          return self._get_build_requires(config_settings, requirements=['wheel'])
                 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
        File "C:\Users\ryanx\AppData\Local\Temp\pip-build-env-oibpm6st\overlay\Lib\site-packages\setuptools\build_meta.py", line 323, in _get_build_requires
          self.run_setup()
        File "C:\Users\ryanx\AppData\Local\Temp\pip-build-env-oibpm6st\overlay\Lib\site-packages\setuptools\build_meta.py", line 488, in run_setup
          self).run_setup(setup_script=setup_script)
                ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
        File "C:\Users\ryanx\AppData\Local\Temp\pip-build-env-oibpm6st\overlay\Lib\site-packages\setuptools\build_meta.py", line 338, in run_setup
          exec(code, locals())
        File "<string>", line 34, in <module>
        File "C:\Users\ryanx\AppData\Local\Temp\pip-install-yayqx6q8\dipy_b3de624e2c0649d78e7848b753dafd11\cythexts.py", line 7, in <module>
          from packaging.version import Version
      ModuleNotFoundError: No module named 'packaging'
      [end of output]

  note: This error originates from a subprocess, and is likely not a problem with pip.
error: subprocess-exited-with-error

× Getting requirements to build wheel did not run successfully.
│ exit code: 1
╰─> See above for output.

note: This error originates from a subprocess, and is likely not a problem with pip.
Failed with error #1.
Press any key to continue . . .

It seems that the ‘packging’ module can’t be recognised.

I also tried to install dipy 1.5.0 in the terminal:

C:\Users\ryanx>pip install packaging
Requirement already satisfied: packaging in c:\users\ryanx\appdata\local\programs\python\python311\lib\site-packages (23.1)

C:\Users\ryanx>pip install dipy==1.5.0
Collecting dipy==1.5.0
  Using cached dipy-1.5.0.tar.gz (11.8 MB)
  Installing build dependencies ... done
  Getting requirements to build wheel ... error
  error: subprocess-exited-with-error

  × Getting requirements to build wheel did not run successfully.
  │ exit code: 1
  ╰─> [23 lines of output]
      Traceback (most recent call last):
        File "C:\Users\ryanx\AppData\Local\Programs\Python\Python311\Lib\site-packages\pip\_vendor\pyproject_hooks\_in_process\_in_process.py", line 353, in <module>
          main()
        File "C:\Users\ryanx\AppData\Local\Programs\Python\Python311\Lib\site-packages\pip\_vendor\pyproject_hooks\_in_process\_in_process.py", line 335, in main
          json_out['return_val'] = hook(**hook_input['kwargs'])
                                   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
        File "C:\Users\ryanx\AppData\Local\Programs\Python\Python311\Lib\site-packages\pip\_vendor\pyproject_hooks\_in_process\_in_process.py", line 118, in get_requires_for_build_wheel
          return hook(config_settings)
                 ^^^^^^^^^^^^^^^^^^^^^
        File "C:\Users\ryanx\AppData\Local\Temp\pip-build-env-ge_fk47a\overlay\Lib\site-packages\setuptools\build_meta.py", line 341, in get_requires_for_build_wheel
          return self._get_build_requires(config_settings, requirements=['wheel'])
                 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
        File "C:\Users\ryanx\AppData\Local\Temp\pip-build-env-ge_fk47a\overlay\Lib\site-packages\setuptools\build_meta.py", line 323, in _get_build_requires
          self.run_setup()
        File "C:\Users\ryanx\AppData\Local\Temp\pip-build-env-ge_fk47a\overlay\Lib\site-packages\setuptools\build_meta.py", line 488, in run_setup
          self).run_setup(setup_script=setup_script)
                ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
        File "C:\Users\ryanx\AppData\Local\Temp\pip-build-env-ge_fk47a\overlay\Lib\site-packages\setuptools\build_meta.py", line 338, in run_setup
          exec(code, locals())
        File "<string>", line 34, in <module>
        File "C:\Users\ryanx\AppData\Local\Temp\pip-install-my66xiye\dipy_c553eaf143c04f82a5613e7f33b220f4\cythexts.py", line 7, in <module>
          from packaging.version import Version
      ModuleNotFoundError: No module named 'packaging'
      [end of output]

  note: This error originates from a subprocess, and is likely not a problem with pip.
error: subprocess-exited-with-error

× Getting requirements to build wheel did not run successfully.
│ exit code: 1
╰─> See above for output.

note: This error originates from a subprocess, and is likely not a problem with pip.

C:\Users\ryanx>pip install dipy
Collecting dipy
  Downloading dipy-1.7.0-cp311-none-win_amd64.whl (7.4 MB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 7.4/7.4 MB 8.8 MB/s eta 0:00:00
Collecting h5py>=2.8.0 (from dipy)
  Downloading h5py-3.8.0-cp311-cp311-win_amd64.whl (2.6 MB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 2.6/2.6 MB 16.7 MB/s eta 0:00:00
Requirement already satisfied: nibabel>=3.0.0 in c:\users\ryanx\appdata\local\programs\python\python311\lib\site-packages (from dipy) (5.1.0)
Collecting tqdm>=4.30.0 (from dipy)
  Downloading tqdm-4.65.0-py3-none-any.whl (77 kB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 77.1/77.1 kB ? eta 0:00:00
Requirement already satisfied: numpy>=1.14.5 in c:\users\ryanx\appdata\local\programs\python\python311\lib\site-packages (from h5py>=2.8.0->dipy) (1.24.3)
Requirement already satisfied: packaging>=17 in c:\users\ryanx\appdata\local\programs\python\python311\lib\site-packages (from nibabel>=3.0.0->dipy) (23.1)
Collecting colorama (from tqdm>=4.30.0->dipy)
  Downloading colorama-0.4.6-py2.py3-none-any.whl (25 kB)
Installing collected packages: h5py, colorama, tqdm, dipy
Successfully installed colorama-0.4.6 dipy-1.7.0 h5py-3.8.0 tqdm-4.65.0

Instead, version 1.7.0 can be successfully installed.

Thank you for taking the time to experiment. I’m glad that dipy 1.7 works!

In that case, here is what I would do:

  1. Open the existing spinalcordtoolbox installation folder.
  2. Open the file requirements-freeze.txt
  3. Change the version number of dipy from 1.5.0 to 1.7.0
  4. Run the copy of "install_sct.bat" that exists inside the spinalcordtoolbox folder. (This will reinstall SCT v5.8, but it will also pick up the change to the dipy version number.)

I’m sorry for all the trouble! Thank you for your patience in resolving this issue. :slight_smile:

Kind regards,
Joshua

Hi @joshuacwnewton,

Sorry for the late reply.

After I changed the version number of dipy, the installation went well until some other packages failed to install due to incompatible Python version. Then I realised I had been using Python 3.11.3 all this time which might be causing the errors.

So I installed Python 3.8.10 and SCT 5.8 was successfully installed. Then I typed

sct_check_dependencies

and another error occurred:

MANDATORY DEPENDENCIES
----------------------
Check Python executable.............................[OK]
  Using bundled python 3.8.10 (tags/v3.8.10:3d8993a, May  3 2021, 11:48:03) [MSC v.1928 64 bit (AMD64)] at C:\Users\ryanx\spinalcordtoolbox\venv_sct\Scripts\python.exe
Check if data are installed.........................[OK]
Traceback (most recent call last):
  File "C:\Users\ryanx\spinalcordtoolbox\venv_sct\lib\site-packages\numpy\core\__init__.py", line 23, in <module>
    from . import multiarray
  File "C:\Users\ryanx\spinalcordtoolbox\venv_sct\lib\site-packages\numpy\core\multiarray.py", line 10, in <module>
    from . import overrides
  File "C:\Users\ryanx\spinalcordtoolbox\venv_sct\lib\site-packages\numpy\core\overrides.py", line 6, in <module>
    from numpy.core._multiarray_umath import (
ModuleNotFoundError: No module named 'numpy.core._multiarray_umath'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "c:\users\ryanx\spinalcordtoolbox\spinalcordtoolbox\scripts\sct_check_dependencies.py", line 388, in <module>
    main(sys.argv[1:])
  File "c:\users\ryanx\spinalcordtoolbox\spinalcordtoolbox\scripts\sct_check_dependencies.py", line 289, in main
    import matplotlib.pyplot as plt
  File "C:\Users\ryanx\spinalcordtoolbox\venv_sct\lib\site-packages\matplotlib\__init__.py", line 108, in <module>
    import numpy
  File "C:\Users\ryanx\spinalcordtoolbox\venv_sct\lib\site-packages\numpy\__init__.py", line 140, in <module>
    from . import core
  File "C:\Users\ryanx\spinalcordtoolbox\venv_sct\lib\site-packages\numpy\core\__init__.py", line 49, in <module>
    raise ImportError(msg)
ImportError:

IMPORTANT: PLEASE READ THIS FOR ADVICE ON HOW TO SOLVE THIS ISSUE!

Importing the numpy C-extensions failed. This error can happen for
many reasons, often due to issues with your setup or how NumPy was
installed.

We have compiled some common reasons and troubleshooting tips at:

    https://numpy.org/devdocs/user/troubleshooting-importerror.html

Please note and check the following:

  * The Python version is: Python3.8 from "C:\Users\ryanx\spinalcordtoolbox\venv_sct\Scripts\python.exe"
  * The NumPy version is: "1.23.5"

and make sure that they are the versions you expect.
Please carefully study the documentation linked above for further help.

Original error was: No module named 'numpy.core._multiarray_umath'

This would definitely be the cause of the issue. Good catch! (Note: When the upcoming SCT v6.0 is released, you will no longer need to rely on a system Python; the installer will take care of that for you.)

The error message links to a NumPy page that provides common troubleshooting tips. But, I don’t think most of those situations apply to this case, because we aren’t using conda.

So, as a starting point, we can try to reinstall setuptools and numpy, just in case something went wrong while installing those packages. Could you please open up a Command Prompt window and run the following commands:

C:\Users\ryanx\spinalcordtoolbox\venv_sct\Scripts\activate
# NB: You should see "(venv_sct)" appear in the terminal after running `activate`
# Make sure that "(venv_sct)" is present before running the following commands
pip install --upgrade --force-reinstall --no-cache-dir setuptools 
pip install --force-reinstall --no-cache-dir numpy==1.23.5

Then try sct_check_dependencies once more.

Thank you kindly,
Joshua

Thank you so much!

Now I get the following errors:

Check if voxelmorph is installed....................[FAIL]
An error occured while importing module voxelmorph -> [WinError 126] The specified module could not be found. Error loading "C:\Users\ryanx\spinalcordtoolbox\venv_sct\lib\site-packages\torch\lib\torch_python.dll" or one of its dependencies.
Full traceback: Traceback (most recent call last):
  File "c:\users\ryanx\spinalcordtoolbox\spinalcordtoolbox\scripts\sct_check_dependencies.py", line 299, in main
    module = module_import(module_name, suppress_stderr)
  File "c:\users\ryanx\spinalcordtoolbox\spinalcordtoolbox\scripts\sct_check_dependencies.py", line 105, in module_import
    module = importlib.import_module(module_name)
  File "C:\Users\ryanx\AppData\Local\Programs\Python\Python38\lib\importlib\__init__.py", line 127, in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
  File "<frozen importlib._bootstrap>", line 1014, in _gcd_import
  File "<frozen importlib._bootstrap>", line 991, in _find_and_load
  File "<frozen importlib._bootstrap>", line 975, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 671, in _load_unlocked
  File "<frozen importlib._bootstrap_external>", line 848, in exec_module
  File "<frozen importlib._bootstrap>", line 219, in _call_with_frames_removed
  File "C:\Users\ryanx\spinalcordtoolbox\venv_sct\lib\site-packages\voxelmorph\__init__.py", line 12, in <module>
    import neurite
  File "C:\Users\ryanx\spinalcordtoolbox\venv_sct\lib\site-packages\neurite\__init__.py", line 38, in <module>
    import torch
  File "C:\Users\ryanx\spinalcordtoolbox\venv_sct\lib\site-packages\torch\__init__.py", line 137, in <module>
    raise err
OSError: [WinError 126] The specified module could not be found. Error loading "C:\Users\ryanx\spinalcordtoolbox\venv_sct\lib\site-packages\torch\lib\torch_python.dll" or one of its dependencies.

Check if wquantiles is installed....................[OK] (0.4)
Check if spinalcordtoolbox is installed.............[OK]
Check ANTs compatibility with OS ...................[FAIL]
============================= test session starts =============================
platform win32 -- Python 3.8.10, pytest-7.2.0, pluggy-1.0.0 -- C:\Users\ryanx\spinalcordtoolbox\venv_sct\Scripts\python.exe
cachedir: .pytest_cache
rootdir: C:\Users\ryanx\spinalcordtoolbox, configfile: setup.cfg
plugins: console-scripts-1.3.1, cov-4.0.0
collecting ... collected 0 items / 1 error

=================================== ERRORS ====================================
_____________ ERROR collecting testing/dependencies/test_ants.py ______________
ImportError while importing test module 'C:\Users\ryanx\spinalcordtoolbox\testing\dependencies\test_ants.py'.
Hint: make sure your test modules/packages have valid Python names.
Traceback:
AppData\Local\Programs\Python\Python38\lib\importlib\__init__.py:127: in import_module
return _bootstrap._gcd_import(name[level:], package, level)
spinalcordtoolbox\testing\dependencies\test_ants.py:15: in <module>
from spinalcordtoolbox.scripts import sct_dice_coefficient
spinalcordtoolbox\spinalcordtoolbox\scripts\sct_dice_coefficient.py:21: in <module>
from spinalcordtoolbox.math import binarize
spinalcordtoolbox\spinalcordtoolbox\math.py:12: in <module>
from dipy.segment.mask import median_otsu
spinalcordtoolbox\venv_sct\lib\site-packages\dipy\segment\mask.py:6: in <module>
from dipy.reconst.dti import fractional_anisotropy, color_fa
spinalcordtoolbox\venv_sct\lib\site-packages\dipy\reconst\dti.py:13: in <module>
from dipy.data import get_sphere
spinalcordtoolbox\venv_sct\lib\site-packages\dipy\data\__init__.py:10: in <module>
from dipy.core.gradients import GradientTable, gradient_table
spinalcordtoolbox\venv_sct\lib\site-packages\dipy\core\gradients.py:10: in <module>
from dipy.core.sphere import disperse_charges, HemiSphere
spinalcordtoolbox\venv_sct\lib\site-packages\dipy\core\sphere.py:9: in <module>
from dipy.reconst.recspeed import remove_similar_vertices
E   ModuleNotFoundError: No module named 'dipy.reconst.recspeed'
=========================== short test summary info ===========================
ERROR spinalcordtoolbox\testing\dependencies\test_ants.py
!!!!!!!!!!!!!!!!!!! Interrupted: 1 error during collection !!!!!!!!!!!!!!!!!!!!
======================== 3 warnings, 1 error in 2.07s =========================
Skipping PropSeg compatibility check ...............[  ] (Not supported on 'native' Windows (without WSL))
Check if figure can be opened with PyQt.............[OK]
Check if figure can be opened with matplotlib.......[OK] (Using GUI backend: 'QtAgg')

I tried to reinstall voxelmorth using the following command but it didn’t work.

pip install --force-reinstall --no-cache-dir voxelmorph==0.2

It’s very strange that multiple packages are failing all at once! I’ve never seen this happen during a Windows installation of SCT. It may be possible that there were some network issues of some sort during the previous run of install_sct.bat, and several packages were installed incorrectly. :thinking:

That said, based on the following portions of the error messages:

It seems as though the problematic packages are torch and dipy. So, I would try to reinstall them as follows:

pip install --force-reinstall --no-cache-dir "torch>=1.8.1,<=1.11.0"
pip install --force-reinstall --no-cache-dir dipy==1.5.0

If this still doesn’t work, then I might recommend simply re-running install_sct.bat in its entirety, just to see if a fresh start fixes all of these scattered package issues.

((Again, my apologies for all of these assorted issues. Thank you for your patience as we sort this out.))

Kind regards,
Joshua

I think it finally works after reinstalling torch and dipy. The output are as follows:

MANDATORY DEPENDENCIES
----------------------
Check Python executable.............................[OK]
  Using bundled python 3.8.10 (tags/v3.8.10:3d8993a, May  3 2021, 11:48:03) [MSC v.1928 64 bit (AMD64)] at C:\Users\ryanx\spinalcordtoolbox\venv_sct\Scripts\python.exe
Check if data are installed.........................[OK]
Check if dipy is installed..........................[OK] (1.5.0)
Check if ivadomed is installed......................[OK] (2.9.7)
Check if matplotlib is installed....................[OK] (3.7.1)
Check if msvc-runtime (14.29.30133) is installed....[OK]
Check if nibabel is installed.......................[OK] (3.2.2)
Check if nilearn is installed.......................[OK] (0.9.2)
Check if numpy is installed.........................[OK] (1.24.3)
Check if onnxruntime is installed...................[OK] (1.13.1)
Check if pandas is installed........................[OK] (1.4.4)
Check if portalocker is installed...................[OK] (2.6.0)
Check if psutil is installed........................[OK] (5.9.4)
Check if pyqt5 is installed.........................[OK] (5.15.9)
Check if pytest is installed........................[OK] (7.2.0)
Check if pytest-cov is installed....................[OK] (4.0.0)
Check if raven is installed.........................[OK]
Check if requests is installed......................[OK] (2.28.1)
Check if requirements-parser is installed...........[OK]
Check if scipy is installed.........................[OK] (1.9.1)
Check if scikit-image is installed..................[OK] (0.20.0)
Check if scikit-learn is installed..................[OK] (1.2.2)
Check if xlwt is installed..........................[OK] (1.3.0)
Check if tqdm is installed..........................[OK] (4.65.0)
Check if transforms3d is installed..................[OK] (0.4.1)
Check if urllib3 is installed.......................[OK] (1.26.13)
Check if pytest_console_scripts is installed........[OK]
Check if pyyaml is installed........................[OK] (6.0)
Check if voxelmorph is installed....................[OK] (0.2)
Check if wquantiles is installed....................[OK] (0.4)
Check if spinalcordtoolbox is installed.............[OK]
Check ANTs compatibility with OS ...................[OK]
Skipping PropSeg compatibility check ...............[  ] (Not supported on 'native' Windows (without WSL))
Check if figure can be opened with PyQt.............[OK]
Check if figure can be opened with matplotlib.......[OK] (Using GUI backend: 'QtAgg')

It seems the main problem is at my end and it’s been quite a journey.

My sincerest thanks for helping me work this out.

Best regards,
Ryan

1 Like