Closed jamesobutler closed 3 weeks ago
Same for me.
On Ubuntu 24.04.1 LTS and python3.12.3
I can also install monai
successfully. The setuptool : 75.2.0
Would appreciate any help in getting this going :-)
Collecting numpymaxflow>=0.0.6 (from monailabel==0.8.4+1.ga112200)
Using cached numpymaxflow-0.0.6.tar.gz (14 kB)
Installing build dependencies ... error
error: subprocess-exited-with-error
× pip subprocess to install build dependencies did not run successfully.
│ exit code: 1
╰─> [56 lines of output]
Collecting setuptools
Using cached setuptools-75.2.0-py3-none-any.whl.metadata (6.9 kB)
Collecting numpy==1.22.0
Using cached numpy-1.22.0.zip (11.3 MB)
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 'error'
error: subprocess-exited-with-error
× Getting requirements to build wheel did not run successfully.
│ exit code: 1
╰─> [33 lines of output]
Traceback (most recent call last):
File "/home/ravi/Documents/.testenv/lib/python3.12/site-packages/pip/_vendor/pyproject_hooks/_in_process/_in_process.py", line 353, in <module>
main()
File "/home/ravi/Documents/.testenv/lib/python3.12/site-packages/pip/_vendor/pyproject_hooks/_in_process/_in_process.py", line 335, in main
json_out['return_val'] = hook(**hook_input['kwargs'])
^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/ravi/Documents/.testenv/lib/python3.12/site-packages/pip/_vendor/pyproject_hooks/_in_process/_in_process.py", line 112, in get_requires_for_build_wheel
backend = _build_backend()
^^^^^^^^^^^^^^^^
File "/home/ravi/Documents/.testenv/lib/python3.12/site-packages/pip/_vendor/pyproject_hooks/_in_process/_in_process.py", line 77, in _build_backend
obj = import_module(mod_path)
^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/lib/python3.12/importlib/__init__.py", line 90, in import_module
return _bootstrap._gcd_import(name[level:], package, level)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "<frozen importlib._bootstrap>", line 1387, in _gcd_import
File "<frozen importlib._bootstrap>", line 1360, in _find_and_load
File "<frozen importlib._bootstrap>", line 1310, in _find_and_load_unlocked
File "<frozen importlib._bootstrap>", line 488, in _call_with_frames_removed
File "<frozen importlib._bootstrap>", line 1387, in _gcd_import
File "<frozen importlib._bootstrap>", line 1360, in _find_and_load
File "<frozen importlib._bootstrap>", line 1331, in _find_and_load_unlocked
File "<frozen importlib._bootstrap>", line 935, in _load_unlocked
File "<frozen importlib._bootstrap_external>", line 995, in exec_module
File "<frozen importlib._bootstrap>", line 488, in _call_with_frames_removed
File "/tmp/pip-build-env-41fdo9nd/overlay/lib/python3.12/site-packages/setuptools/__init__.py", line 16, in <module>
import setuptools.version
File "/tmp/pip-build-env-41fdo9nd/overlay/lib/python3.12/site-packages/setuptools/version.py", line 1, in <module>
import pkg_resources
File "/tmp/pip-build-env-41fdo9nd/overlay/lib/python3.12/site-packages/pkg_resources/__init__.py", line 2172, in <module>
register_finder(pkgutil.ImpImporter, find_on_path)
^^^^^^^^^^^^^^^^^^^
AttributeError: module 'pkgutil' has no attribute 'ImpImporter'. Did you mean: 'zipimporter'?
[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.
[end of output]
note: This error originates from a subprocess, and is likely not a problem with pip.
error: subprocess-exited-with-error
× pip subprocess to install build dependencies 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.
Correct. Have requested the dependent to be available for 3.12.
Otherwise for now it's kind of not officially supported. But it shall be fixed sooner to support python 3.12
Note that MONAI-Label itself uses distutils as well in several places, so simply building numpymaxflow
does not suffice and a straightforward patch akin to https://github.com/Project-MONAI/MONAI/pull/7900 is needed.
@SachidanandAlle @jamesobutler I have just released numpymaxflow v0.0.7 that supports python 3.12 Could you run this test again and update in case the problem persists from numpymaxflow side?
I haven't tried runtime usage, but monailabel install on Python 3.12 is no longer blocked by the build of numpymaxflow.
re https://github.com/Project-MONAI/MONAILabel/issues/1750#issuecomment-2448058092 and the distutils
usage, indeed a newer setuptools
version is needed for Python 3.12 as done in https://github.com/Project-MONAI/MONAI/commit/58106a6255f5936d26e479d11d3a34e3d536c112. Importing monailabel
and distutils
worked for me because disutils
came vendored in the setuptools
version that was grabbed (75.3.0).
Describe the bug I run into issues running
pip install monailabel
using Python 3.12. I was able to successfully runpip install monai
successfully though.Currently the project specifies that it should be able to be installed on python 3.8 or newer which would include Python 3.12 (originally released October 2, 2023). https://github.com/Project-MONAI/MONAILabel/blob/ac65ad3e1077d7157c35bce88783268cda405383/setup.cfg#L30
To Reproduce Steps to reproduce the behavior:
pip install monailabel
Observe the following output:
× pip subprocess to install build dependencies did not run successfully. │ exit code: 2 ╰─> See above for output.
note: This error originates from a subprocess, and is likely not a problem with pip.
Collecting monai Using cached monai-1.3.2-py3-none-any.whl.metadata (10 kB) Collecting torch>=1.9 (from monai) Downloading torch-2.4.1-cp312-cp312-win_amd64.whl.metadata (27 kB) Collecting numpy>=1.20 (from monai) Downloading numpy-2.1.2-cp312-cp312-win_amd64.whl.metadata (59 kB) Collecting filelock (from torch>=1.9->monai) Downloading filelock-3.16.1-py3-none-any.whl.metadata (2.9 kB) Collecting typing-extensions>=4.8.0 (from torch>=1.9->monai) Using cached typing_extensions-4.12.2-py3-none-any.whl.metadata (3.0 kB) Collecting sympy (from torch>=1.9->monai) Using cached sympy-1.13.3-py3-none-any.whl.metadata (12 kB) Collecting networkx (from torch>=1.9->monai) Using cached networkx-3.3-py3-none-any.whl.metadata (5.1 kB) Collecting jinja2 (from torch>=1.9->monai) Using cached jinja2-3.1.4-py3-none-any.whl.metadata (2.6 kB) Collecting fsspec (from torch>=1.9->monai) Using cached fsspec-2024.9.0-py3-none-any.whl.metadata (11 kB) Collecting setuptools (from torch>=1.9->monai) Using cached setuptools-75.1.0-py3-none-any.whl.metadata (6.9 kB) Collecting MarkupSafe>=2.0 (from jinja2->torch>=1.9->monai) Downloading MarkupSafe-3.0.1-cp312-cp312-win_amd64.whl.metadata (4.1 kB) Collecting mpmath<1.4,>=1.1.0 (from sympy->torch>=1.9->monai) Using cached mpmath-1.3.0-py3-none-any.whl.metadata (8.6 kB) Using cached monai-1.3.2-py3-none-any.whl (1.4 MB) Downloading numpy-2.1.2-cp312-cp312-win_amd64.whl (12.6 MB) ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 12.6/12.6 MB 24.6 MB/s eta 0:00:00 Downloading torch-2.4.1-cp312-cp312-win_amd64.whl (199.4 MB) ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 199.4/199.4 MB 31.0 MB/s eta 0:00:00 Using cached typing_extensions-4.12.2-py3-none-any.whl (37 kB) Downloading filelock-3.16.1-py3-none-any.whl (16 kB) Using cached fsspec-2024.9.0-py3-none-any.whl (179 kB) Using cached jinja2-3.1.4-py3-none-any.whl (133 kB) Using cached networkx-3.3-py3-none-any.whl (1.7 MB) Using cached setuptools-75.1.0-py3-none-any.whl (1.2 MB) Using cached sympy-1.13.3-py3-none-any.whl (6.2 MB) Downloading MarkupSafe-3.0.1-cp312-cp312-win_amd64.whl (15 kB) Using cached mpmath-1.3.0-py3-none-any.whl (536 kB) Installing collected packages: mpmath, typing-extensions, sympy, setuptools, numpy, networkx, MarkupSafe, fsspec, filelock, jinja2, torch, monai WARNING: The script isympy.exe is installed in 'C:\Users\butlej30383\AppData\Local\Programs\Python\Python312\Scripts' which is not on PATH. Consider adding this directory to PATH or, if you prefer to suppress this warning, use --no-warn-script-location. WARNING: The scripts f2py.exe and numpy-config.exe are installed in 'C:\Users\butlej30383\AppData\Local\Programs\Python\Python312\Scripts' which is not on PATH. Consider adding this directory to PATH or, if you prefer to suppress this warning, use --no-warn-script-location. WARNING: The scripts convert-caffe2-to-onnx.exe, convert-onnx-to-caffe2.exe and torchrun.exe are installed in 'C:\Users\butlej30383\AppData\Local\Programs\Python\Python312\Scripts' which is not on PATH. Consider adding this directory to PATH or, if you prefer to suppress this warning, use --no-warn-script-location. Successfully installed MarkupSafe-3.0.1 filelock-3.16.1 fsspec-2024.9.0 jinja2-3.1.4 monai-1.3.2 mpmath-1.3.0 networkx-3.3 numpy-2.1.2 setuptools-75.1.0 sympy-1.13.3 torch-2.4.1 typing-extensions-4.12.2