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

TypeError: import_optional_dependency() got an unexpected keyword argument 'errors' #72

Open
ziadzee opened this issue Sep 24, 2021 · 1 comment

Comments

@ziadzee
Copy link

ziadzee commented Sep 24, 2021

Hello,

I'm trying to import DeepTables into my Google Colab notebook like so:

import deeptables
from deeptables.models import make_experiment
from deeptables.models.hyper_dt import DTModuleSpace, DnnModule, DTFit

However, I am met with the following errors:

TypeError                                 Traceback (most recent call last)
<ipython-input-20-5ce1cb115d93> in <module>()
     50 
     51 import deeptables
---> 52 from deeptables.models import make_experiment
     53 from deeptables.models.hyper_dt import DTModuleSpace, DnnModule, DTFit

11 frames
/usr/local/lib/python3.7/dist-packages/deeptables/models/__init__.py in <module>()
      2 __author__ = 'yangjian'
      3 
----> 4 from deeptables.models.config import ModelConfig
      5 from deeptables.models.modelset import ModelInfo, ModelSet
      6 from deeptables.models.deeptable import DeepTable

/usr/local/lib/python3.7/dist-packages/deeptables/models/config.py in <module>()
      3 import collections
      4 import os
----> 5 from ..utils import consts
      6 from . import deepnets as deepnets
      7 

/usr/local/lib/python3.7/dist-packages/deeptables/utils/__init__.py in <module>()
      4 
      5 """
----> 6 from hypernets.utils import fs, hash_data, infer_task_type, load_data, isnotebook
      7 from hypernets.tabular.metrics import calc_score

/usr/local/lib/python3.7/dist-packages/hypernets/utils/__init__.py in <module>()
      8 from ._fsutils import filesystem as fs
      9 from ._tic_tok import tic_toc, report as tic_toc_report, report_as_dataframe as tic_toc_report_as_dataframe
---> 10 from .common import generate_id, combinations, isnotebook, Counter, to_repr, get_params
     11 from .common import infer_task_type, hash_data, hash_dataframe, load_data, load_module
     12 from ._estimators import load_estimator, save_estimator

/usr/local/lib/python3.7/dist-packages/hypernets/utils/common.py in <module>()
     15 
     16 import dask.array as da
---> 17 import dask.dataframe as dd
     18 import numpy as np
     19 import pandas as pd

/usr/local/lib/python3.7/dist-packages/dask/dataframe/__init__.py in <module>()
      1 try:
----> 2     from .core import (
      3         DataFrame,
      4         Series,
      5         Index,

/usr/local/lib/python3.7/dist-packages/dask/dataframe/core.py in <module>()
     75 no_default = "__no_default__"
     76 
---> 77 pd.set_option("compute.use_numexpr", False)
     78 
     79 

/usr/local/lib/python3.7/dist-packages/pandas/_config/config.py in __call__(self, *args, **kwds)
    231 # class below which wraps functions inside a callable, and converts
    232 # __doc__ into a property function. The doctsrings below are templates
--> 233 # using the py2.6+ advanced formatting syntax to plug in a concise list
    234 # of options, and option descriptions.
    235 

/usr/local/lib/python3.7/dist-packages/pandas/_config/config.py in _set_option(*args, **kwargs)
    139         if o and o.validator:
    140             o.validator(v)
--> 141 
    142         # walk the nested dict
    143         root, k = _get_root(key)

/usr/local/lib/python3.7/dist-packages/pandas/core/config_init.py in use_numexpr_cb(key)
     48 
     49 
---> 50 def use_numexpr_cb(key):
     51     from pandas.core.computation import expressions
     52 

/usr/local/lib/python3.7/dist-packages/pandas/core/computation/expressions.py in <module>()
     17 from pandas._typing import FuncType
     18 
---> 19 from pandas.core.computation.check import NUMEXPR_INSTALLED
     20 from pandas.core.ops import roperator
     21 

/usr/local/lib/python3.7/dist-packages/pandas/core/computation/check.py in <module>()
      1 from pandas.compat._optional import import_optional_dependency
      2 
----> 3 ne = import_optional_dependency("numexpr", errors="warn")
      4 NUMEXPR_INSTALLED = ne is not None
      5 if NUMEXPR_INSTALLED:

TypeError: import_optional_dependency() got an unexpected keyword argument 'errors'

The strange thing is that everything imports normally without errors on a local Jupyter Notebook however it's throwing this error on Colab. My pandas version is the latest build and I'm unable to find the issue with this. Has anyone has a similar issue on Colab? Thanks

@lixfz
Copy link
Collaborator

lixfz commented Oct 8, 2021

What python packages are you installed?
Run pip list and paste the outputs here pls.

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