lululxvi/deepxde

ImportError check_pandas_support

aoguedao opened this issue · 4 comments

Hi Dr. Lu and DeepXDE team -

I just created a new environment for working with deepxde using JAX as a backend and I got the following error after changing the backend with python -m deepxde.backend.set_default_backend jax

ImportError: cannot import name 'check_pandas_support' from 'sklearn.utils' (/mnt/c/Users/aogueda/Documents/git/misc/sciml/lib/python3.12/site-packages/sklearn/utils/__init__.py)

I think it is because 'check_pandas_support' has a new path according to this commit in scikit-learn.

I am using WSL2, miniforge for virtual environments and I installed scikit-learn using conda/mamba but JAX and DeepXDE with pip as the final step of setting my environment.

Edit: I forgot to add the versions of my packages

python                    3.12.3          hab00c5b_0_cpython    conda-forge
scikit-learn              1.5.0           py312h1fcc3ea_1    conda-forge
scikit-optimize           0.10.1                   pypi_0    pypi
scipy                     1.13.1          py312hc2bc53b_0    conda-forge
deepxde                   1.11.1                   pypi_0    pypi
jax                       0.4.28                   pypi_0    pypi
jax-cuda12-pjrt           0.4.28                   pypi_0    pypi
jax-cuda12-plugin         0.4.28                   pypi_0    pypi
jaxlib                    0.4.28                   pypi_0    pypi

Thanks in advance.

Hi aoguedao,

interestingly I ran into the exact same problem today. You have to downgrade scikit-learn to Version 1.3.0.

I also opened an issue today but closed it. There you can lookt it up.

Hi aoguedao,

interestingly I ran into the exact same problem today. You have to downgrade scikit-learn to Version 1.3.0.

I also opened an issue today but closed it. There you can lookt it up.

Thank you! I'll downgrade scikit-learn for now then. Appreciate it!

@aoguedao scikit-learn moves the check_pandas_support api according to here, downgrade to scikit-learn <= 1.4.2 can solve the problem

or you can modify the source code by doing this (for scikit-learn == 1.5.0)

- from sklearn.utils import check_pandas_support
+ from sklearn.utils._optional_dependencies import check_pandas_support

@entropy2333 Thank you very much, changing the path clears the issue right up! I was having this same issue trying to start working with the Deepxde package yesterday.