From 11473630ee906e67c32b1bf28bbc94d4eb098dd7 Mon Sep 17 00:00:00 2001 From: Eric Kerfoot <17726042+ericspod@users.noreply.github.com> Date: Thu, 30 Jul 2026 13:28:12 +0100 Subject: [PATCH 01/11] Adding check_env.py script Signed-off-by: Eric Kerfoot <17726042+ericspod@users.noreply.github.com> --- monai/config/__main__.py | 14 +++ monai/config/check_env.py | 184 +++++++++++++++++++++++++++++++++++ monai/config/deviceconfig.py | 55 ++++++----- 3 files changed, 231 insertions(+), 22 deletions(-) create mode 100644 monai/config/__main__.py create mode 100644 monai/config/check_env.py diff --git a/monai/config/__main__.py b/monai/config/__main__.py new file mode 100644 index 0000000000..bfd3e0bac4 --- /dev/null +++ b/monai/config/__main__.py @@ -0,0 +1,14 @@ +# Copyright (c) MONAI Consortium +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# http://www.apache.org/licenses/LICENSE-2.0 +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +if __name__ == "__main__": + import monai + monai.config.print_debug_info() diff --git a/monai/config/check_env.py b/monai/config/check_env.py new file mode 100644 index 0000000000..f3331f0a80 --- /dev/null +++ b/monai/config/check_env.py @@ -0,0 +1,184 @@ +#! /usr/bin/env python + +# Copyright (c) MONAI Consortium +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# http://www.apache.org/licenses/LICENSE-2.0 +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +""" +Script for checking various elements of the runtime environment and printing a large amount of diagnostic information. + +This is meant to be used for debugging environments used with MONAI, but doesn't directly need MONAI itself. It will +print information about the environment, including trying to get installed packages, test PyTorch with CUDA, and then +have MONAI print its debugging information if no errors encountered. If MONAI is not installed this script should still +work and produce useful information. Only standard libraries are needed in case a bare environment is being used. + +This can be run as a program with the following options to see all outputs: + + python check_env.py --env --envvars --monai + +With no options at all this can be used to test that PyTorch is installed and can move a tensor to a device. This is +useful when creating a fresh test environment and MONAI isn't present yet but it's good practice to valid PyTorch. + +This can also be used remotely with only Python installed to get current environment diagnostic info: + + curl https://raw.githubusercontent.com/Project-MONAI/MONAI/refs/heads/dev/monai/config/check_env.py | python +""" + +from io import StringIO +import os +import sys +import platform +import multiprocessing +import subprocess +import shutil +import argparse +import getpass +from functools import partial + +DESC = """ +Script for checking various elements of the runtime environment and printing a large amount of diagnostic information. +This is used for debugging your environment by printing out various system statistics and diagnostic information. It +checks PyTorch and MONAI are installed and functioning. A typical use case is with the `--env` and `--monai` options. +""" + + +USER = getpass.getuser() +HOST = platform.node() +efprint = partial(print, flush=True, file=sys.stderr) + + +def fprint(*args, **kwargs): + """ + Print with flushing, replacing the username and hostname values with placeholders for better anonymization. + """ + kwargs["flush"] = True + content = " ".join(map(str, args)) + content = content.replace(USER, "").replace(HOST, "") + print(content, **kwargs) + + +def print_platform(): + """ + Print basic platform information. + """ + fprint(platform.platform()) + fprint("uname:", list(platform.uname())) + fprint("CPU:", platform.processor(), "Count:", multiprocessing.cpu_count()) + fprint("Python:", sys.executable, platform.python_implementation(), platform.python_version()) + + +def print_environment_vars(): + """ + Print all environment variables other than a few known pointless ones. + """ + fprint("Environment:") + for k, v in os.environ.items(): + if k not in ("LS_COLORS", "PS1", "PS2"): + fprint(f" {k}:", v) + + +def print_environment(): + """ + Print the installed environment using `conda` or `pip`, fail if neither are present. + """ + try: + cmd = ("conda", "env", "export") if shutil.which("conda") else ("pip", "list") + + result = subprocess.check_output(cmd, stderr=subprocess.STDOUT) + fprint(result.decode()) + return True + except Exception as e: + efprint(f"Exception encountered getting environment with conda/pip: {e}") + return False + + +def check_torch(): + """ + Check PyTorch is installed and a tensor can be created. + """ + try: + import torch + + t = torch.rand(2, 3) * 5 + fprint("PyTorch:", torch.__version__, torch.__path__) + fprint("Test tensor:", t.flatten()) + return True + except ImportError: + efprint("PyTorch not installed") + return False + + +def check_torch_cuda(): + """ + Check CUDA capability in PyTorch by moving a tensor to each available device. + """ + import torch + + dcount = torch.cuda.device_count() + fprint("CUDA version:", torch.version.cuda) + fprint("PyTorch GPU Count:", dcount) + + try: + for d in range(dcount): + fprint(f" {torch.cuda.get_device_properties(d)}") + t = torch.rand(2, 3).to(torch.device(f"cuda:{d}")) * 5 + fprint("Test tensor:", t.flatten()) + return True + except Exception as e: + efprint(f"PyTorch encountered exception creating GPU tensor on device {d}: {e}") + return False + + +def check_monai(): + """ + Check MONAI by importing it then printing its debug info. + """ + try: + import monai + + out = StringIO() + monai.config.deviceconfig.print_debug_info(file=out) + out.seek(0) + fprint(out.read()) + return True + except ImportError: + efprint("MONAI not installed") + return False + + +if __name__ == "__main__": + parser = argparse.ArgumentParser(prog="check_env.py", description=DESC.strip()) + parser.add_argument("--env", default=False, action="store_true", help="Print environment info") + parser.add_argument("--envvars", default=False, action="store_true", help="Include environment variables") + parser.add_argument("--monai", default=False, action="store_true", help="Print MONAI info") + args = parser.parse_args() + + fprint("=" * 10, "Platform Info", "=" * 10) + print_platform() + + if args.env: + fprint("=" * 10, "Checking Environment", "=" * 10) + if args.envvars: + print_environment_vars() + print_environment() + + fprint("=" * 10, "Checking PyTorch", "=" * 10) + + if not check_torch(): + efprint("Exiting early, no valid PyTorch install found.") + sys.exit(1) + + if not check_torch_cuda(): + efprint("Exiting early, PyTorch encountered CUDA error.") + sys.exit(1) + + if args.monai: + fprint("=" * 10, "Checking MONAI", "=" * 10) + check_monai() diff --git a/monai/config/deviceconfig.py b/monai/config/deviceconfig.py index 5800651e59..051ed3f3e0 100644 --- a/monai/config/deviceconfig.py +++ b/monai/config/deviceconfig.py @@ -50,6 +50,19 @@ "IgniteInfo", ] +USER = getpass.getuser() +HOST = platform.node() + + +def fprint(*args, **kwargs): + """ + Print with flushing, replacing the username and hostname values with placeholders for better anonymization. + """ + kwargs["flush"] = True + content = " ".join(map(str, args)) + content = content.replace(USER, "").replace(HOST, "") + print(content, **kwargs) + def get_config_values(): """ @@ -100,17 +113,15 @@ def print_config(file=sys.stdout): file: `print()` text stream file. Defaults to `sys.stdout`. """ for k, v in get_config_values().items(): - print(f"{k} version: {v}", file=file, flush=True) - print(f"MONAI flags: HAS_EXT = {HAS_EXT}, USE_COMPILED = {USE_COMPILED}, USE_META_DICT = {USE_META_DICT}") - print(f"MONAI rev id: {monai.__revision_id__}") - username = getpass.getuser() - masked_file_path = re.sub(username, "", monai.__file__) - print(f"MONAI __file__: {masked_file_path}", file=file, flush=True) - print("\nOptional dependencies:", file=file, flush=True) + fprint(f"{k} version: {v}", file=file) + fprint(f"MONAI flags: HAS_EXT = {HAS_EXT}, USE_COMPILED = {USE_COMPILED}, USE_META_DICT = {USE_META_DICT}") + fprint(f"MONAI rev id: {monai.__revision_id__}") + fprint(f"MONAI __file__: {monai.__file__}", file=file) + fprint("\nOptional dependencies:", file=file) for k, v in get_optional_config_values().items(): - print(f"{k} version: {v}", file=file, flush=True) - print("\nFor details about installing the optional dependencies, please visit:", file=file, flush=True) - print( + fprint(f"{k} version: {v}", file=file) + fprint("\nFor details about installing the optional dependencies, please visit:", file=file) + fprint( " https://monai.readthedocs.io/en/latest/installation.html#installing-the-recommended-dependencies\n", file=file, flush=True, @@ -191,10 +202,10 @@ def print_system_info(file: TextIO = sys.stdout) -> None: file: `print()` text stream file. Defaults to `sys.stdout`. """ if not has_psutil: - print("`psutil` required for `print_system_info`", file=file, flush=True) + fprint("`psutil` required for `print_system_info`", file=file) else: for k, v in get_system_info().items(): - print(f"{k}: {v}", file=file, flush=True) + fprint(f"{k}: {v}", file=file) def get_gpu_info() -> OrderedDict: @@ -239,7 +250,7 @@ def print_gpu_info(file: TextIO = sys.stdout) -> None: file: `print()` text stream file. Defaults to `sys.stdout`. """ for k, v in get_gpu_info().items(): - print(f"{k}: {v}", file=file, flush=True) + fprint(f"{k}: {v}", file=file) def print_debug_info(file: TextIO = sys.stdout) -> None: @@ -249,17 +260,17 @@ def print_debug_info(file: TextIO = sys.stdout) -> None: Args: file: `print()` text stream file. Defaults to `sys.stdout`. """ - print("================================", file=file, flush=True) - print("Printing MONAI config...", file=file, flush=True) - print("================================", file=file, flush=True) + fprint("================================", file=file) + fprint("Printing MONAI config...", file=file) + fprint("================================", file=file) print_config(file) - print("\n================================", file=file, flush=True) - print("Printing system config...") - print("================================", file=file, flush=True) + fprint("\n================================", file=file) + fprint("Printing system config...", file=file) + fprint("================================", file=file) print_system_info(file) - print("\n================================", file=file, flush=True) - print("Printing GPU config...") - print("================================", file=file, flush=True) + fprint("\n================================", file=file) + fprint("Printing GPU config...", file=file) + fprint("================================", file=file) print_gpu_info(file) From 433f66a25bf41b60fe07860f33aec0a03d0e0a3d Mon Sep 17 00:00:00 2001 From: Eric Kerfoot <17726042+ericspod@users.noreply.github.com> Date: Thu, 30 Jul 2026 13:28:39 +0100 Subject: [PATCH 02/11] Remove deprecation Signed-off-by: Eric Kerfoot <17726042+ericspod@users.noreply.github.com> --- monai/config/deviceconfig.py | 7 ------- 1 file changed, 7 deletions(-) diff --git a/monai/config/deviceconfig.py b/monai/config/deviceconfig.py index 051ed3f3e0..5db082b494 100644 --- a/monai/config/deviceconfig.py +++ b/monai/config/deviceconfig.py @@ -274,12 +274,5 @@ def print_debug_info(file: TextIO = sys.stdout) -> None: print_gpu_info(file) -@deprecated(since="1.4.0", removed="1.6.0", msg_suffix="Please use `monai.utils.enums.IgniteInfo` instead.") -class IgniteInfo: - """Deprecated Import of IgniteInfo enum, which was moved to `monai.utils.enums.IgniteInfo`.""" - - OPT_IMPORT_VERSION = _IgniteInfo.OPT_IMPORT_VERSION - - if __name__ == "__main__": print_debug_info() From fe993f4b4921ecbe9515669aa58d43242480023d Mon Sep 17 00:00:00 2001 From: Eric Kerfoot <17726042+ericspod@users.noreply.github.com> Date: Thu, 30 Jul 2026 13:32:49 +0100 Subject: [PATCH 03/11] Fixes Signed-off-by: Eric Kerfoot <17726042+ericspod@users.noreply.github.com> --- monai/config/__init__.py | 1 - monai/config/deviceconfig.py | 4 ++-- tests/config/test_print_info.py | 5 ++++- 3 files changed, 6 insertions(+), 4 deletions(-) diff --git a/monai/config/__init__.py b/monai/config/__init__.py index c814e1f8eb..a83889aee0 100644 --- a/monai/config/__init__.py +++ b/monai/config/__init__.py @@ -14,7 +14,6 @@ from .deviceconfig import ( USE_COMPILED, USE_META_DICT, - IgniteInfo, get_config_values, get_gpu_info, get_optional_config_values, diff --git a/monai/config/deviceconfig.py b/monai/config/deviceconfig.py index 5db082b494..c88c0e893d 100644 --- a/monai/config/deviceconfig.py +++ b/monai/config/deviceconfig.py @@ -114,8 +114,8 @@ def print_config(file=sys.stdout): """ for k, v in get_config_values().items(): fprint(f"{k} version: {v}", file=file) - fprint(f"MONAI flags: HAS_EXT = {HAS_EXT}, USE_COMPILED = {USE_COMPILED}, USE_META_DICT = {USE_META_DICT}") - fprint(f"MONAI rev id: {monai.__revision_id__}") + fprint(f"MONAI flags: HAS_EXT = {HAS_EXT}, USE_COMPILED = {USE_COMPILED}, USE_META_DICT = {USE_META_DICT}",file=file) + fprint(f"MONAI rev id: {monai.__revision_id__}",file=file) fprint(f"MONAI __file__: {monai.__file__}", file=file) fprint("\nOptional dependencies:", file=file) for k, v in get_optional_config_values().items(): diff --git a/tests/config/test_print_info.py b/tests/config/test_print_info.py index aa152e183c..9a33e7fa58 100644 --- a/tests/config/test_print_info.py +++ b/tests/config/test_print_info.py @@ -11,6 +11,7 @@ from __future__ import annotations +from io import StringIO import unittest from monai.config import print_debug_info @@ -19,7 +20,9 @@ class TestPrintInfo(unittest.TestCase): def test_print_info(self): - print_debug_info() + out = StringIO() + print_debug_info(file=out) + self.assertGreater(out.tell(), 0) if __name__ == "__main__": From 51370d04a825d26f243c73278232111c02c0972a Mon Sep 17 00:00:00 2001 From: Eric Kerfoot <17726042+ericspod@users.noreply.github.com> Date: Thu, 30 Jul 2026 13:42:20 +0100 Subject: [PATCH 04/11] Tweak CI script to use check_env Signed-off-by: Eric Kerfoot <17726042+ericspod@users.noreply.github.com> --- .github/workflows/cicd_tests.yml | 23 +++++++---------------- 1 file changed, 7 insertions(+), 16 deletions(-) diff --git a/.github/workflows/cicd_tests.yml b/.github/workflows/cicd_tests.yml index d48e3a02f2..305dc42f32 100644 --- a/.github/workflows/cicd_tests.yml +++ b/.github/workflows/cicd_tests.yml @@ -148,16 +148,10 @@ jobs: python -m pip list BUILD_MONAI=0 python setup.py develop # no compile of extensions shell: bash - - if: matrix.os == 'linux-gpu-runner' - name: Print GPU Info - run: | - nvidia-smi - python -c 'import torch; print(torch.rand(2,2).to("cuda:0"))' - shell: bash - name: Run quick tests run: | - python -c 'import torch; print(torch.__version__); print(torch.rand(5,3))' - python -c "import monai; monai.config.print_config()" + nvidia-smi || true + python monai/config/check_env.py --env --monai ./runtests.sh --min shell: bash env: @@ -229,19 +223,18 @@ jobs: run: | python -m pip uninstall -y monai BUILD_MONAI=1 python -m pip install --no-build-isolation -e . # compile the cpp extensions + + nvidia-smi || true + python monai/config/check_env.py --env --monai shell: bash - if: runner.os != 'macOS' name: Run full tests run: | - python -c 'import torch; print(torch.__version__); print(torch.rand(5,3))' - python -c "import monai; monai.config.print_config()" python -m unittest -v shell: bash - if: runner.os == 'macOS' name: Run min tests run: | - python -c 'import torch; print(torch.__version__); print(torch.rand(5,3))' - python -c "import monai; monai.config.print_config()" # TODO: enable large range of macOS tests which don't take a very long time ./runtests.sh --min shell: bash @@ -351,8 +344,7 @@ jobs: run: | # install from wheel python -m pip install monai*.whl --extra-index-url https://download.pytorch.org/whl/cpu - python -c 'import monai; monai.config.print_config()' 2>&1 | grep -iv "unknown" - python -c 'import monai; print(monai.__file__)' + python monai/config/check_env.py --env --monai python -m pip uninstall -y monai rm monai*.whl - name: Install source archive @@ -361,5 +353,4 @@ jobs: for name in *.tar.gz; do break; done echo $name python -m pip install ${name}[all] --extra-index-url https://download.pytorch.org/whl/cpu - python -c 'import monai; monai.config.print_config()' 2>&1 | grep -iv "unknown" - python -c 'import monai; print(monai.__file__)' + python monai/config/check_env.py --env --monai From 079f5e5dfa7fc3c2bba192390c544def6847f627 Mon Sep 17 00:00:00 2001 From: Eric Kerfoot <17726042+ericspod@users.noreply.github.com> Date: Thu, 30 Jul 2026 13:49:53 +0100 Subject: [PATCH 05/11] Fixes Signed-off-by: Eric Kerfoot <17726042+ericspod@users.noreply.github.com> --- monai/config/deviceconfig.py | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/monai/config/deviceconfig.py b/monai/config/deviceconfig.py index c88c0e893d..6e433115b2 100644 --- a/monai/config/deviceconfig.py +++ b/monai/config/deviceconfig.py @@ -23,8 +23,6 @@ import torch import monai -from monai.utils.deprecate_utils import deprecated -from monai.utils.enums import IgniteInfo as _IgniteInfo from monai.utils.module import OptionalImportError, get_package_version, optional_import try: @@ -114,8 +112,8 @@ def print_config(file=sys.stdout): """ for k, v in get_config_values().items(): fprint(f"{k} version: {v}", file=file) - fprint(f"MONAI flags: HAS_EXT = {HAS_EXT}, USE_COMPILED = {USE_COMPILED}, USE_META_DICT = {USE_META_DICT}",file=file) - fprint(f"MONAI rev id: {monai.__revision_id__}",file=file) + fprint(f"MONAI flags: {HAS_EXT=}, {USE_COMPILED=}, {USE_META_DICT=}", file=file) + fprint(f"MONAI rev id: {monai.__revision_id__}", file=file) fprint(f"MONAI __file__: {monai.__file__}", file=file) fprint("\nOptional dependencies:", file=file) for k, v in get_optional_config_values().items(): From 77750f402b95def8774959ecf3b2491876109237 Mon Sep 17 00:00:00 2001 From: Eric Kerfoot <17726042+ericspod@users.noreply.github.com> Date: Sat, 1 Aug 2026 12:13:48 +0100 Subject: [PATCH 06/11] Fix Signed-off-by: Eric Kerfoot <17726042+ericspod@users.noreply.github.com> --- MANIFEST.in | 1 + monai/config/deviceconfig.py | 1 - 2 files changed, 1 insertion(+), 1 deletion(-) diff --git a/MANIFEST.in b/MANIFEST.in index 66650af6be..aac0c2ccae 100644 --- a/MANIFEST.in +++ b/MANIFEST.in @@ -1,5 +1,6 @@ include versioneer.py include monai/_version.py +include monai/config/check_env.py include README.md include LICENSE diff --git a/monai/config/deviceconfig.py b/monai/config/deviceconfig.py index 6e433115b2..6a0d2378aa 100644 --- a/monai/config/deviceconfig.py +++ b/monai/config/deviceconfig.py @@ -45,7 +45,6 @@ "print_debug_info", "USE_COMPILED", "USE_META_DICT", - "IgniteInfo", ] USER = getpass.getuser() From 2ce4eeaa64f738ae5d712d9a9644168a4c253273 Mon Sep 17 00:00:00 2001 From: Eric Kerfoot <17726042+ericspod@users.noreply.github.com> Date: Sat, 1 Aug 2026 13:01:46 +0100 Subject: [PATCH 07/11] Fix Signed-off-by: Eric Kerfoot <17726042+ericspod@users.noreply.github.com> --- monai/config/check_env.py | 19 ++++++++----------- tests/config/test_print_info.py | 2 +- 2 files changed, 9 insertions(+), 12 deletions(-) diff --git a/monai/config/check_env.py b/monai/config/check_env.py index f3331f0a80..e13c105e10 100644 --- a/monai/config/check_env.py +++ b/monai/config/check_env.py @@ -31,15 +31,16 @@ curl https://raw.githubusercontent.com/Project-MONAI/MONAI/refs/heads/dev/monai/config/check_env.py | python """ -from io import StringIO +from __future__ import annotations + +import argparse +import getpass +import multiprocessing import os -import sys import platform -import multiprocessing -import subprocess import shutil -import argparse -import getpass +import subprocess +import sys from functools import partial DESC = """ @@ -48,7 +49,6 @@ checks PyTorch and MONAI are installed and functioning. A typical use case is with the `--env` and `--monai` options. """ - USER = getpass.getuser() HOST = platform.node() efprint = partial(print, flush=True, file=sys.stderr) @@ -143,10 +143,7 @@ def check_monai(): try: import monai - out = StringIO() - monai.config.deviceconfig.print_debug_info(file=out) - out.seek(0) - fprint(out.read()) + monai.config.print_debug_info() return True except ImportError: efprint("MONAI not installed") diff --git a/tests/config/test_print_info.py b/tests/config/test_print_info.py index 9a33e7fa58..da91c43149 100644 --- a/tests/config/test_print_info.py +++ b/tests/config/test_print_info.py @@ -11,8 +11,8 @@ from __future__ import annotations -from io import StringIO import unittest +from io import StringIO from monai.config import print_debug_info From dcdfaa16358df8baa0c903fe09b53703a68d90fc Mon Sep 17 00:00:00 2001 From: Eric Kerfoot <17726042+ericspod@users.noreply.github.com> Date: Sun, 2 Aug 2026 10:59:01 +0100 Subject: [PATCH 08/11] Ci change Signed-off-by: Eric Kerfoot <17726042+ericspod@users.noreply.github.com> --- .github/workflows/cicd_tests.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/cicd_tests.yml b/.github/workflows/cicd_tests.yml index 305dc42f32..71ffffd748 100644 --- a/.github/workflows/cicd_tests.yml +++ b/.github/workflows/cicd_tests.yml @@ -344,7 +344,7 @@ jobs: run: | # install from wheel python -m pip install monai*.whl --extra-index-url https://download.pytorch.org/whl/cpu - python monai/config/check_env.py --env --monai + python -m monai.config python -m pip uninstall -y monai rm monai*.whl - name: Install source archive @@ -353,4 +353,4 @@ jobs: for name in *.tar.gz; do break; done echo $name python -m pip install ${name}[all] --extra-index-url https://download.pytorch.org/whl/cpu - python monai/config/check_env.py --env --monai + python monai.config From d8b3ffdbc59340cd9085b0223b9083ee0b82302c Mon Sep 17 00:00:00 2001 From: Eric Kerfoot <17726042+ericspod@users.noreply.github.com> Date: Sun, 2 Aug 2026 11:23:05 +0100 Subject: [PATCH 09/11] Fix Signed-off-by: Eric Kerfoot <17726042+ericspod@users.noreply.github.com> --- .github/workflows/cicd_tests.yml | 2 +- monai/config/__main__.py | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/cicd_tests.yml b/.github/workflows/cicd_tests.yml index 71ffffd748..c2c6f05b5a 100644 --- a/.github/workflows/cicd_tests.yml +++ b/.github/workflows/cicd_tests.yml @@ -353,4 +353,4 @@ jobs: for name in *.tar.gz; do break; done echo $name python -m pip install ${name}[all] --extra-index-url https://download.pytorch.org/whl/cpu - python monai.config + python -m monai.config diff --git a/monai/config/__main__.py b/monai/config/__main__.py index bfd3e0bac4..97f64e27a5 100644 --- a/monai/config/__main__.py +++ b/monai/config/__main__.py @@ -11,4 +11,5 @@ if __name__ == "__main__": import monai + monai.config.print_debug_info() From 91799fb445ad9813b4e0f0ebc80952141bcd3414 Mon Sep 17 00:00:00 2001 From: Eric Kerfoot <17726042+ericspod@users.noreply.github.com> Date: Sun, 2 Aug 2026 11:41:47 +0100 Subject: [PATCH 10/11] mypy fail Signed-off-by: Eric Kerfoot <17726042+ericspod@users.noreply.github.com> --- monai/config/check_env.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/monai/config/check_env.py b/monai/config/check_env.py index e13c105e10..0dcb8fb3a7 100644 --- a/monai/config/check_env.py +++ b/monai/config/check_env.py @@ -143,7 +143,7 @@ def check_monai(): try: import monai - monai.config.print_debug_info() + monai.config.print_debug_info() # type: ignore return True except ImportError: efprint("MONAI not installed") From 4460d442463ad4368c7d985bed21cbd5bf2acc1f Mon Sep 17 00:00:00 2001 From: Eric Kerfoot <17726042+ericspod@users.noreply.github.com> Date: Sun, 2 Aug 2026 18:04:31 +0100 Subject: [PATCH 11/11] mypy fail Signed-off-by: Eric Kerfoot <17726042+ericspod@users.noreply.github.com> --- monai/config/__main__.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/monai/config/__main__.py b/monai/config/__main__.py index 97f64e27a5..13b1cc9d51 100644 --- a/monai/config/__main__.py +++ b/monai/config/__main__.py @@ -12,4 +12,4 @@ if __name__ == "__main__": import monai - monai.config.print_debug_info() + monai.config.print_debug_info() # type: ignore