causalml icon indicating copy to clipboard operation
causalml copied to clipboard

No module named 'causalml.inference.tree.causaltree'

Open alittlesong opened this issue 5 years ago • 3 comments

Describe the bug I installed causalml from pip and got the error of "ModuleNotFoundError: No module named 'causalml.inference.tree.causaltree'" when importing the following functions/packages:

from causalml.dataset import make_uplift_classification from causalml.inference.tree import UpliftTreeClassifier, UpliftRandomForestClassifier from causalml.inference.tree import uplift_tree_string, uplift_tree_plot

I am able to import meta learner packages like:

from causalml.inference.meta import LRSRegressor from causalml.inference.meta import XGBTRegressor, MLPTRegressor from causalml.inference.meta import BaseXRegressor, BaseRRegressor, BaseSRegressor, BaseTRegressor from causalml.match import NearestNeighborMatch, MatchOptimizer, create_table_one from causalml.propensity import ElasticNetPropensityModel

To Reproduce pip install causalml

Expected behavior import causal tree packages successfully

Screenshots image

Environment (please complete the following information):

  • OS: macOS
  • Python Version: 3.7.6
  • Versions of Major Dependencies (pandas, scikit-learn, cython): pandas==1.0.4, scikit-learn==0.22, cython==0.29.15, 'numpy = 1.18.2']

Additional context I tried to clone the repository and compile the Cython modules myself from the source code using python setup.py build_ext --inplace (follwing https://github.com/uber/causalml/issues/148), I did see some warnings "Using deprecated NumPy API, disable it by", but I still have issue to import causal tree.

alittlesong avatar Jul 01 '20 03:07 alittlesong

Thanks for reporting the issue, @alittlesong. I just tried it with the same versions of packages, but couldn't reproduce the error (see the screenshot below). Screen Shot 2020-07-02 at 11 11 43 AM

Could you try to remove any cached or previous installation of causalml and install again as follows?

# from somewhere not in the causalml source directory
$ pip uninstall causalml 
$ pip install --no-cache-dir -U causalml

Please let me know if it helps.

jeongyoonlee avatar Jul 02 '20 18:07 jeongyoonlee

Hi, @alittlesong, were you able to resolve the issue?

jeongyoonlee avatar Sep 16 '20 17:09 jeongyoonlee

@alittlesong would like to know if you were able to resolve the issue, I made sure the requirements were fine on my end but still getting the error.

adilahiri avatar Nov 20 '20 22:11 adilahiri

close this for now. Feel free to reopen is there is still an error.

vincewu51 avatar Aug 19 '23 00:08 vincewu51