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: numpy.core.multiarray failed to import #2088

Open
quocdat-le-insacvl opened this issue May 30, 2023 · 1 comment
Open

ImportError: numpy.core.multiarray failed to import #2088

quocdat-le-insacvl opened this issue May 30, 2023 · 1 comment

Comments

@quocdat-le-insacvl
Copy link

Describe the bug
Hi, I'm trying to run:

from raiwidgets import ExplanationDashboard
ExplanationDashboard(global_explanation, model, dataset=x_test_scaled, true_y=y_test)

but I got the error:

RuntimeError                              Traceback (most recent call last)
File __init__.pxd:942, in numpy.import_array()

RuntimeError: module compiled against API version 0x10 but this version of numpy is 0xf . Check the section C-API incompatibility at the Troubleshooting ImportError section at https://numpy.org/devdocs/user/troubleshooting-importerror.html#c-api-incompatibility for indications on how to solve this problem .

During handling of the above exception, another exception occurred:

ImportError                               Traceback (most recent call last)
Cell In[29], line 1
----> 1 from responsibleai import RAIInsights

File [c:\Users\Q1636743\project\interpret_dashboard\.venv\lib\site-packages\responsibleai\__init__.py:8](file:///C:/Users/Q1636743/project/interpret_dashboard/.venv/lib/site-packages/responsibleai/__init__.py:8)
      6 # ModelTask is only imported for backwards compatibility
      7 from raiutils.models import ModelTask
----> 8 from responsibleai.modelanalysis import ModelAnalysis
      9 from responsibleai.rai_insights import RAIInsights
     11 from .__version__ import version

File [c:\Users\Q1636743\project\interpret_dashboard\.venv\lib\site-packages\responsibleai\modelanalysis\__init__.py:8](file:///C:/Users/Q1636743/project/interpret_dashboard/.venv/lib/site-packages/responsibleai/modelanalysis/__init__.py:8)
      6 # ModelTask is only imported for backwards compatibility
      7 from raiutils.models import ModelTask
----> 8 from responsibleai.modelanalysis.model_analysis import ModelAnalysis
     10 __all__ = ["ModelAnalysis", "ModelTask"]

File [c:\Users\Q1636743\project\interpret_dashboard\.venv\lib\site-packages\responsibleai\modelanalysis\model_analysis.py:13](file:///C:/Users/Q1636743/project/interpret_dashboard/.venv/lib/site-packages/responsibleai/modelanalysis/model_analysis.py:13)
     10 import pandas as pd
     12 from responsibleai.feature_metadata import FeatureMetadata
---> 13 from responsibleai.managers.causal_manager import CausalManager
     14 from responsibleai.managers.counterfactual_manager import CounterfactualManager
     15 from responsibleai.managers.error_analysis_manager import ErrorAnalysisManager

File [c:\Users\Q1636743\project\interpret_dashboard\.venv\lib\site-packages\responsibleai\managers\causal_manager.py:10](file:///C:/Users/Q1636743/project/interpret_dashboard/.venv/lib/site-packages/responsibleai/managers/causal_manager.py:10)
      8 import numpy as np
      9 import pandas as pd
---> 10 from econml.solutions.causal_analysis import CausalAnalysis
     12 from raiutils.models import ModelTask
     13 from responsibleai._data_validations import validate_train_test_categories

File [c:\Users\Q1636743\project\interpret_dashboard\.venv\lib\site-packages\econml\solutions\causal_analysis\__init__.py:4](file:///C:/Users/Q1636743/project/interpret_dashboard/.venv/lib/site-packages/econml/solutions/causal_analysis/__init__.py:4)
      1 # Copyright (c) PyWhy contributors. All rights reserved.
      2 # Licensed under the MIT License.
----> 4 from ._causal_analysis import CausalAnalysis
      6 __all__ = ["CausalAnalysis"]
...
File statsmodels\nonparametric\_smoothers_lowess.pyx:22, in init statsmodels.nonparametric._smoothers_lowess()

File __init__.pxd:944, in numpy.import_array()

ImportError: numpy.core.multiarray failed to import

To Reproduce
Steps to reproduce the behavior:

  1. I've just installed these packages : interpret-community lightgbm interpret raiwidgets
  2. Train a model
  3. And run the code above

Packages version

raiwidgets           0.27.0
numpy                1.22.4
pandas               1.5.3
interpret-community 0.29.0
@hawestra
Copy link
Contributor

Hi @quocdat-le-insacvl! I'm sorry for the delay in response; could you please tell me what version of python you are using ? We've seen issues in the past where certain versions of python cause this error when running certain version of numpy and shap

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

3 participants
@hawestra @quocdat-le-insacvl and others