Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ImportError check_pandas_support #1754

Open
aoguedao opened this issue May 24, 2024 · 4 comments
Open

ImportError check_pandas_support #1754

aoguedao opened this issue May 24, 2024 · 4 comments

Comments

@aoguedao
Copy link

aoguedao commented May 24, 2024

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.

@dezenn
Copy link

dezenn commented May 24, 2024

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.

@aoguedao
Copy link
Author

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!

@entropy2333
Copy link

entropy2333 commented May 28, 2024

@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

@AWBroscius
Copy link

@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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants