salesforce / OmniXAI

OmniXAI: A Library for eXplainable AI
BSD 3-Clause "New" or "Revised" License
878 stars 94 forks source link

import issue #92

Open AmirMK opened 1 year ago

AmirMK commented 1 year ago

I am using omnixai 1.3.1 abd get the following error when import the TabularExplainer:

from omnixai.explainers.tabular import TabularExplainer

Error:


---------------------------------------------------------------------------
ModuleNotFoundError                       Traceback (most recent call last)
File ~/opt/anaconda3/envs/xai/lib/python3.9/site-packages/aiohttp/client_reqrep.py:70
     69 try:
---> 70     import cchardet as chardet
     71 except ImportError:  # pragma: no cover

ModuleNotFoundError: No module named 'cchardet'

During handling of the above exception, another exception occurred:

ImportError                               Traceback (most recent call last)
Cell In[1], line 31
     28 from scipy.stats import chi2_contingency
     29 import xgboost as xgb
---> 31 from omnixai.explainers.tabular import TabularExplainer
     32 from omnixai.data.tabular import Tabular

File ~/opt/anaconda3/envs/xai/lib/python3.9/site-packages/omnixai/explainers/tabular/__init__.py:17
     15 from .agnostic.shap_global import GlobalShapTabular
     16 from .agnostic.bias import BiasAnalyzer
---> 17 from .agnostic.gpt import GPTExplainer
     18 from .counterfactual.mace.mace import MACEExplainer
     19 from .counterfactual.ce import CounterfactualExplainer

File ~/opt/anaconda3/envs/xai/lib/python3.9/site-packages/omnixai/explainers/tabular/agnostic/gpt.py:11
      7 """
      8 The explainer based ChatGPT.
      9 """
     10 import os
---> 11 import openai
     12 from typing import Callable, List
     13 from omnixai.data.tabular import Tabular
yangwenz commented 1 year ago

Hi, could you please try to reinstall the openai lib? It seems that aiohttp is not compatible with openai. If the error still occurs, please let me know.