forked from spinalcordtoolbox/spinalcordtoolbox
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathrequirements.txt
More file actions
103 lines (102 loc) · 6.54 KB
/
requirements.txt
File metadata and controls
103 lines (102 loc) · 6.54 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
# NB: Any lines marked with 'append_to_freeze' will be copied over to `requirements-freeze.txt` when creating SCT's
# stable releases. We do this because `pip freeze` will not capture options (e.g. --extra-index-url) or
# platform-specific requirements (e.g. sys.platform == 'win32')
# acvl_utils is a utility package used by `nnunetv2`. v0.2.1 broke usage of `nnunetv2`, so skip it:
# See: https://github.com/spinalcordtoolbox/spinalcordtoolbox/issues/4679
acvl_utils!=0.2.1
# blosc2 is a utility package used by `nnunetv2`, and v3.9.0 required `numpy==2.0`
# However, 3.9.0 specifically forgot to specify `>=2.0`, so it will break if installed alongside `numpy==1.26`
# 3.9.1 and above re-added `numpy==1.26` support, so it is safe to skip this version but allow newer versions
# See: https://github.com/Blosc/python-blosc2/issues/485
blosc2!=3.9.0
# Avoid 1.6 and 1.7 due to method=restore bug: https://github.com/spinalcordtoolbox/spinalcordtoolbox/issues/4209#issuecomment-1739644328
dipy==1.8.0
# Avoid 3.15.0 due to known build errors on older versions of macOS (https://github.com/h5py/h5py/issues/2720)
h5py!=3.15.0
# PyTorch's Linux distribution is very large due to its GPU support,
# but we only need that for training models. Our users only need CPU.
--extra-index-url https://download.pytorch.org/whl/cpu # append_to_freeze
ivadomed
matplotlib
# `matplotlib-inline` is an optional package that comes with `jupyter` for use with the '%matplotlib inline' directive.
# However, if the user runs `jupyter` from a separate environment and sets '%matplotlib inline', then SCT's
# environment will be missing this backend, and SCT scripts will crash when trying to import matplotlib. So, we install
# `matplotlib-inline` in our env by default to ensure that SCT scripts can be run in Jupyter notebooks without error.
matplotlib-inline
monai[nibabel]
# Fresh Windows installations may be missing the C++ runtime library required by onnxruntime, scikit-image, etc.
# Installing "Microsoft Visual C++ Redistributable for Visual Studio" will fix this too, but
# we'd prefer not to burden users with another prerequisite.
# (The version is pinned because this line gets copied to requirements-freeze.txt when preparing a release, not because we're avoiding bugs with a specific version. It should be actively upgraded, or else it may cause issues when upgrading other packages. See:
# https://github.com/spinalcordtoolbox/spinalcordtoolbox/pull/4906/files#r2105230162)
msvc-runtime==14.42.34433; sys.platform == 'win32' # append_to_freeze
nibabel
nilearn
# - Notes for stock `nnunetv2`:
# 2.3.0 and below are incompatible due to breaking API change (https://github.com/spinalcordtoolbox/spinalcordtoolbox/issues/4380)
# 2.4.0/2.4.1 fail during inference due to https://github.com/spinalcordtoolbox/spinalcordtoolbox/issues/4444
# 2.4.2 causes empty predictions (https://github.com/spinalcordtoolbox/spinalcordtoolbox/issues/4556)
# 2.6 includes an API change that requires `torch>=2.3`. However, `torch==2.3` removes
# support for Intel Macs, and we don't want to remove support, so we use `<2.6`.
# - Notes for `nnunetv2-neuropoly` (our fork):
# 2.6+ is now compatible with older versions of torch (>=2.1.2), so we can use the latest version.
nnunetv2-neuropoly
# SCT is compatible, however the upgrade to numpy==2.0.0 broke *many* upstream packages. Let's try again later. See https://github.com/spinalcordtoolbox/spinalcordtoolbox/issues/4535
numpy<2
# This is a sub-package of `numpy` whose update broke compatibility with older versions of `numpy`.
# This was fixed in 2.14.1. See also: https://github.com/pydata/numexpr/issues/540
numexpr!=2.14.0
# - 1.7.0>onnxruntime>=1.5.1 required `brew install libomp` on macOS.
# So, pin to >=1.7.0 to avoid having to ask users to install libomp.
# - Avoid version 1.16.0 due to: https://github.com/spinalcordtoolbox/spinalcordtoolbox/issues/4225
# - Avoid version 1.22.0 due to DLL error on `windows-2019` runner.
# Note: Upgrading `msvc-runtime` *doesn't* fix this error on `windows-2019`.
onnxruntime>=1.7.0,!=1.16.0,<1.22.0
# onnx==[1.16.2,1.17.0,1.18.0] all cause errors for Python 3.9 + Windows (https://github.com/onnx/onnx/issues/6267#issuecomment-2877327002)
# 1.17.0 can partially work as long as SCT doesn't import it, but this is flaky.
onnx<1.16.2
pandas
portalocker
psutil
# pyqt5=5.15.X causes https://github.com/spinalcordtoolbox/spinalcordtoolbox/issues/3925, however
# to support Python 3.10 and above, there is no other option, so we will need to bite the bullet here.
pyqt5>=5.15.0
# pyqt5>=5.15.0 comes with a separate package, `pyqt5-qt5`. This package is odd, and its only release
# that supports Windows is `5.15.2`. If we _don't_ specify this version, then running `pip freeze` from
# an Ubuntu machine will result in a set of dependencies incompatible with Windows, and we don't want that!
# See also: https://github.com/spinalcordtoolbox/spinalcordtoolbox/issues/4905#issuecomment-2902112975
PyQt5-Qt5==5.15.2
# pystrum==0.2 is incompatible with newer versions of numpy (installed via voxelmorph -> neurite -> pystrum)
# See also: https://github.com/adalca/pystrum/issues/9
pystrum>=0.3
pytest
pytest-cov
requests
requirements-parser
scipy
scikit-image
scikit-learn
totalspineseg[neuropoly]
xlwt
# - torch<2.6: In January 2025, PyTorch changed the default of `torch.load()` to `weights_only=True`, breaking the
# loading of some of our models. We can set `weights_only=False` to retain the old behavior, however
# there are additional calls to `torch.load()` within our dependencies as well, meaning that we need to
# wait until they update themselves (or become compatible with `weights_only=True`). Until then, we can
# pin torch to a version prior to this breaking change.
# - torch<2.3: PyTorch 2.3.0 removed support for Intel Macs. If we leave this unpinned, then version 2.2.2 will be
# installed on Intel Macs, while a newer version (e.g. 2.5.1) will be installed on all other platforms.
# To keep the versions in sync between platforms, we pin torch to `<2.3`. See:
# -> https://github.com/spinalcordtoolbox/spinalcordtoolbox/issues/4781
# - NOTE: nnunetv2 currently requries `torch>=2.1.2`, meaning that the above restriction results in a range of
# `2.1.2 <= torch < 2.3`, i.e. most likely version `2.2.2` will be installed.
torch<2.3 # append_to_freeze
tqdm
transforms3d
urllib3
pytest_console_scripts
pyyaml
voxelmorph
wquantiles
# XlxsWriter is needed to write `.xlsx` files, since pandas removed support for the `xlwt` engine
# Source: https://github.com/pandas-dev/pandas/pull/49296
xlsxwriter