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

Cannot call causalml after installation #684

Closed
MingyueHe opened this issue Sep 25, 2023 · 2 comments
Closed

Cannot call causalml after installation #684

MingyueHe opened this issue Sep 25, 2023 · 2 comments
Labels
bug Something isn't working

Comments

@MingyueHe
Copy link

Describe the bug
I cannot call any class in causalml after installation

To Reproduce

If I call one class in causalml, I will get the following errors:

from causalml.inference.tree import CausalTreeRegressor
Traceback (most recent call last):

Input In [3] in <cell line: 1>
from causalml.inference.tree import CausalTreeRegressor

File ~\Anaconda3\lib\site-packages\causalml\inference\tree_init_.py:1 in
from .causal.causaltree import CausalTreeRegressor

File ~\Anaconda3\lib\site-packages\causalml\inference\tree\causal\causaltree.py:14 in
from causalml.inference.meta.utils import check_treatment_vector

File ~\Anaconda3\lib\site-packages\causalml\inference\meta_init_.py:1 in
from .slearner import LRSRegressor, BaseSLearner, BaseSRegressor, BaseSClassifier

File ~\Anaconda3\lib\site-packages\causalml\inference\meta\slearner.py:9 in
from causalml.inference.meta.base import BaseLearner

File ~\Anaconda3\lib\site-packages\causalml\inference\meta\base.py:6 in
from causalml.inference.meta.explainer import Explainer

File ~\Anaconda3\lib\site-packages\causalml\inference\meta\explainer.py:2 in
import shap

File ~\Anaconda3\lib\site-packages\shap_init_.py:5 in
from ._explanation import Explanation, Cohorts

File ~\Anaconda3\lib\site-packages\shap_explanation.py:13 in
from .utils._exceptions import DimensionError

File ~\Anaconda3\lib\site-packages\shap\utils_init_.py:1 in
from ._clustering import (

File ~\Anaconda3\lib\site-packages\shap\utils_clustering.py:7 in
from numba import njit

File ~\Anaconda3\lib\site-packages\numba_init_.py:200 in
_ensure_critical_deps()

File ~\Anaconda3\lib\site-packages\numba_init_.py:140 in _ensure_critical_deps
raise ImportError("Numba needs NumPy 1.21 or less")

ImportError: Numba needs NumPy 1.21 or less

Since I see this "ImportError: Numba needs NumPy 1.21 or less" ourpur, I try to use numpy version == 1.20.1. However, I face errors again as follows:

from causalml.inference.tree import CausalTreeRegressor
Traceback (most recent call last):

Input In [2] in <cell line: 1>
from causalml.inference.tree import CausalTreeRegressor

File ~\Anaconda3\lib\site-packages\causalml\inference\tree_init_.py:1 in
from .causal.causaltree import CausalTreeRegressor

File ~\Anaconda3\lib\site-packages\causalml\inference\tree\causal\causaltree.py:15 in
from ._tree import BaseCausalDecisionTree

File ~\Anaconda3\lib\site-packages\causalml\inference\tree\causal_tree.py:16 in
from ._builder import DepthFirstCausalTreeBuilder, BestFirstCausalTreeBuilder

File causalml\inference\tree\causal_builder.pyx:1 in init causalml.inference.tree.causal._builder

ValueError: numpy.ndarray size changed, may indicate binary incompatibility. Expected 96 from C header, got 88 from PyObject

Environment (please complete the following information):

  • OS: [Windows]
  • Python Version: 3.9

Additional context
I am quite confused here. Please help me with this.

@MingyueHe MingyueHe added the bug Something isn't working label Sep 25, 2023
@alexander-pv
Copy link
Collaborator

alexander-pv commented Oct 25, 2023

Hi, @MingyueHe, the latest PRs should solve your issue. Please, try to install the package from source.

@jeongyoonlee
Copy link
Collaborator

Closing this as it is resolved in #686.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants