Pip install nvidia-modulus-sym fails in installing dependency: scikit-learn

Hello,

using latest mini-conda python distribution (python 3.11), I can install nvidia-modulus using pip, but pip install nvidia-modulus.sym fails like this:

Collecting scikit-learn==1.0.2
Using cached scikit-learn-1.0.2.tar.gz (6.7 MB)
Installing build dependencies … done
Getting requirements to build wheel … done
Preparing metadata (pyproject.toml) … error
error: subprocess-exited-with-error

× Preparing metadata (pyproject.toml) did not run successfully.
│ exit code: 1
╰─> [1470 lines of output]
Partial import of sklearn during the build process.
setup.py:128: DeprecationWarning:

  Error compiling Cython file:
  ------------------------------------------------------------
  ...
          if n_used_bins <= 1:
              free(cat_infos)
              return
  
          qsort(cat_infos, n_used_bins, sizeof(categorical_info),
                compare_cat_infos)
                ^
  ------------------------------------------------------------
  
  sklearn/ensemble/_hist_gradient_boosting/splitting.pyx:920:14: Cannot assign type 'int (const void *, const void *) except? -1 nogil' to 'int (*)(const void *, const void *) noexcept nogil'. Exception values are incompatible. Suggest adding 'noexcept' to type 'int (const void *, const void *) except? -1 nogil'.
  Traceback (most recent call last):
    File "/tmp/pip-build-env-z8kdndr3/overlay/lib/python3.11/site-packages/Cython/Build/Dependencies.py", line 1345, in cythonize_one_helper
      return cythonize_one(*m)
             ^^^^^^^^^^^^^^^^^
    File "/tmp/pip-build-env-z8kdndr3/overlay/lib/python3.11/site-packages/Cython/Build/Dependencies.py", line 1321, in cythonize_one
      raise CompileError(None, pyx_file)
  Cython.Compiler.Errors.CompileError: sklearn/ensemble/_hist_gradient_boosting/splitting.pyx

My question:

  • I’ve seen at multiple location that scikit-learn==1.0.2 is very old; is it possible to upgrade scikit-learn as a dependency to modulus
  • would you recommend to keep scikit-learn==1.0.2 but change cython version ?
  • would you recommend another solution ?

I don’t quite understand how the current pip package can work with scikit-learn=1.0.2
Any help appreciated

Just for the record, I tried to upgrade scikit-learn to 1.2.0; error message is removed, modulus.sym is installed manually (pip install . from modulus-sym sources).

but then trying examples using modulus-core + modulus.sym, I get runtime error very similar to this github issue:

I anybody knows how to solve this one, that would help. Thanks

I finaly found that I needed to just downgrade from python 3.11 to python 3.10 in my miniconda env, and now I can pip install modulus core and sym, and everything is working fine.

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.