Fail to install SCT on Ubuntu 22.04

Hello,

I’m trying to install SCT (the plb/4995_new_ms_model branch), but it seems to have an issue after installing dipy.
I’m running on Ubuntu 22.04, I just cloned the repo and checked out the branch, then ran ./install_sct -y

I don’t know what changed, but I believed few weeks ago, I managed to install it successfully, but not anymore.

I attached the log file.
install_sct_log.txt (68.2 KB)

Thanks.

Edit: I believe this installation is not working as expected because when trying to import numpy from the created environment, it doesn’t find it:

lchauvin@imaging-gpu-05:/scratch/02/lchauvin/workspace/projects/spinalcordtoolbox$ ./python/envs/venv_sct/bin/python -c 'import numpy as np'

Traceback (most recent call last):
  File "<string>", line 1, in <module>
ModuleNotFoundError: No module named 'numpy'

Edit 2: I also tried to follow the same steps as this test: New multi-fold MS lesion model · spinalcordtoolbox/spinalcordtoolbox@debc01f · GitHub

But I’m still getting the same error.

Edit 3: My understanding is that the installation of dipy is trying to run this code

  ../dipy/meson.build:106:17: ERROR: Command `/scratch/02/lchauvin/workspace/projects/spinalcordtoolbox/python/envs/venv_sct/bin/python3.10 -c '
      import numpy as np
      try:
        incdir = os.path.relpath(np.get_include())
      except Exception:
        incdir = np.get_include()
      print(incdir)
        '` failed with status -6.

However, numpy has not been installed yet.
If I look at the tests, we can see:

Collecting dipy==1.8.0 (from -r requirements.txt (line 12))
  Downloading dipy-1.8.0-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.metadata (8.6 kB)
Collecting ivadomed (from -r requirements.txt (line 16))
  Downloading ivadomed-2.9.10-py3-none-any.whl.metadata (6.4 kB)
Collecting matplotlib (from -r requirements.txt (line 17))
  Downloading matplotlib-3.10.6-cp310-cp310-manylinux2014_x86_64.manylinux_2_17_x86_64.whl.metadata (11 kB)
Collecting matplotlib-inline (from -r requirements.txt (line 22))
  Downloading matplotlib_inline-0.1.7-py3-none-any.whl.metadata (3.9 kB)
Collecting nibabel (from -r requirements.txt (line 30))
  Downloading nibabel-5.3.2-py3-none-any.whl.metadata (9.1 kB)
Collecting nilearn (from -r requirements.txt (line 31))
  Downloading nilearn-0.12.1-py3-none-any.whl.metadata (9.9 kB)
Collecting nnunetv2==2.6.2 (from -r requirements.txt (line 43))
  Downloading nnunetv2-2.6.2.tar.gz (211 kB)
  Installing build dependencies: started
  Installing build dependencies: finished with status 'done'
  Getting requirements to build wheel: started
  Getting requirements to build wheel: finished with status 'done'
  Preparing metadata (pyproject.toml): started
  Preparing metadata (pyproject.toml): finished with status 'done'
Collecting numpy<2 (from -r requirements.txt (line 45))
  Downloading numpy-1.26.4-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.metadata (61 kB)

Numpy is installed after dipy.

It seems the problem is coming from GraalPy somehow that uses a different version of pip:

<frozen graalpy.pip_hook>:48: RuntimeWarning: You are using an untested version of pip. GraalPy provides patches and workarounds for a number of packages when used with compatible pip versions. We recommend to stick with the pip version that ships with this version of GraalPy.
WARNING: Disabling truststore because platform isn't supported

But I don’t understand why.

Edit 4: A collegue of mine find out that installing a new conda is messing up with the existing path. So we modified the install_sct script to use our already existing micromamba installation, and it seems to work that way. But it’s a workaround. There should be a better way to fix this.