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

Problems in Importing Some Modules When Using the Binder #43

Open
LeeGeophysics opened this issue Oct 7, 2021 · 6 comments
Open

Problems in Importing Some Modules When Using the Binder #43

LeeGeophysics opened this issue Oct 7, 2021 · 6 comments

Comments

@LeeGeophysics
Copy link

LeeGeophysics commented Oct 7, 2021

Screenshot 2021-10-06 20 06 02
Dear Geoscixyz Developers,

Hello, I am Jaewook Lee, a teaching assistant at UT Dallas.
I'd like to use your geosci-labs materials for educational purposes in my Applied Geophysics course.
I tried to run some Notebooks via Binder, but I failed to do it with the following error:


ImportError Traceback (most recent call last)
/tmp/ipykernel_157/141298955.py in
1 import numpy as np
----> 2 from geoscilabs.mag import Mag, Simulator
3 from SimPEG.potential_fields import magnetics as mag
4 from SimPEG import utils, data
5 from discretize import TensorMesh

/srv/conda/envs/notebook/lib/python3.8/site-packages/geoscilabs/mag/init.py in
----> 1 from . import Mag
2 from . import Simulator
3 from . import MagDipole
4 from . import MagDipoleApp

/srv/conda/envs/notebook/lib/python3.8/site-packages/geoscilabs/mag/Mag.py in
3 import re
4 import numpy as np
----> 5 from SimPEG import utils, data
6 from SimPEG.potential_fields import magnetics as mag
7

/srv/conda/envs/notebook/lib/python3.8/site-packages/SimPEG/init.py in
6 from discretize import tests
7
----> 8 from .data import Data, SyntheticData
9 from . import data_misfit
10 from . import directives

/srv/conda/envs/notebook/lib/python3.8/site-packages/SimPEG/data.py in
4 import warnings
5
----> 6 from .survey import BaseSurvey
7 from . import survey
8 from .utils import mkvc

/srv/conda/envs/notebook/lib/python3.8/site-packages/SimPEG/survey.py in
4 import properties
5 import warnings
----> 6 from .utils.code_utils import deprecate_property, deprecate_class, deprecate_method
7
8 from .utils import mkvc, Counter

/srv/conda/envs/notebook/lib/python3.8/site-packages/SimPEG/utils/init.py in
57 from .plot_utils import plot2Ddata, plotLayer, plot_1d_layer_model
58 from .io_utils import download
---> 59 from .pgi_utils import (
60 make_SimplePGI_regularization,
61 make_PGI_regularization,

/srv/conda/envs/notebook/lib/python3.8/site-packages/SimPEG/utils/pgi_utils.py in
20 _check_shape,
21 )
---> 22 from sklearn.mixture._base import _check_X, check_random_state, ConvergenceWarning
23 import warnings
24 from .mat_utils import mkvc

ImportError: cannot import name '_check_X' from 'sklearn.mixture._base' (/srv/conda/envs/notebook/lib/python3.8/site-packages/sklearn/mixture/_base.py)

Attached is the screenshot showing the error message on my web browser.
Thank you in advance.

Best regards,
Jaewook Lee

@thast
Copy link
Member

thast commented Oct 7, 2021

Hi @LeeGeophysics,
Thanks for bringing this to our attention. We are aware of the issue (an incompatibility with the new release of scikit-learn). A fix has been put for review and should be available very soon!

@thast
Copy link
Member

thast commented Oct 7, 2021

If you need it urgently, then you can do a manual fix by downgrading to scikit-learn 0.24.2 within the binder notebook. Before running anything else, at the beginning of the notebook, run a cell with: ! pip install scikit-learn==0.24.2

@LeeGeophysics
Copy link
Author

Thank you so much for your prompt reply! @thast
I am not good at using Python and Binder, but I tried to make a cell and downgrade the module you mentioned.
However, I found the same error message as this screenshot. Could you give a few comments? :-)

스크린샷 2021-10-06 오후 8 42 31

@thast
Copy link
Member

thast commented Oct 7, 2021

@LeeGeophysics : you would need to restart the notebook. and run the cell in order as you have them now (with ! pip ... first, just in case). See picture below:
image

@thast
Copy link
Member

thast commented Oct 7, 2021

Let us know if this solves your issue (it does on my side).

@LeeGeophysics
Copy link
Author

Thank you so much @thast , I can use the other Notebooks with this solution. :-)

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

2 participants