-
Notifications
You must be signed in to change notification settings - Fork 86
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
cannot import MimicExplainer #581
Comments
@Dewei-Wang-xx can you try to run:
and print the output of those two commands? Usually there is some issue with the extension logic in interpret/interpret-core package that causes this. |
@imatiach-msft with
There are no script except for "init.py" in \Lib\site-packages\interpret\ext\blackbox |
@Dewei-Wang-xx it seems there is some issue with the extension system on your particular machine/environment, but without debugging with you I can't tell which package in the environment is causing it. I would recommend to setup a meeting to debug this together. If that is not possible, the simple workaround is to use the interpret_community namespace instead of the interpret.ext.* namespace.
You can just import using:
Please see the setup.py file for the full mapping of all classes: https://github.com/interpretml/interpret-community/blob/main/python/setup.py#L90 |
The whole extension system isn't really needed - it's just there to make it look like the interpret-community package is more integrated with the interpret package and the interpretml ecosystem of python packages. But anyone can just import using the original interpret_community namespace instead of using the interpret.ext.* namespace. |
Another way this extension system can break is if there is some package version conflict. For example, I ran the command:
And then I see the failures on import telling me that there is a package version conflict and the version of interpret is too new - downgrading via "pip install interpret-core[required]<=0.4.3" fixes this issue (see the very last line of error):
|
@imatiach-msft thanks a lot! this works for me. But how to get the " from interpret.ext.blackbox import MimicExplainer" working? |
@Dewei-Wang-xx I'm honestly not sure - there should be some error message like above or during install but you are not seeing one. I think the best way to debug this would be to setup a call since you are not seeing anything. The code to setup the extension system is not in this package but in interpret - specifically this method: I think the best way to debug would be to install interpret-core package locally, call this method here in a jupyter notebook: And then either add print statements or use pdb to debug through that extension_utils method above to see what error is thrown or why those extensions aren't getting registered. |
I have recently met this issue:
ImportError: cannot import name 'MimicExplainer' from 'interpret.ext.blackbox' (C:\Users\xxx\Anaconda3\lib\site-packages\interpret\ext\blackbox_init_.py)
but I didn't update the library or related ones. Do anyone see this error as well?
The text was updated successfully, but these errors were encountered: