uber / causalml

Uplift modeling and causal inference with machine learning algorithms
Other
4.99k stars 769 forks source link

Causalml install errors #671

Closed MingyueHe closed 11 months ago

MingyueHe commented 1 year ago

Describe the bug Causalml cannot be properly installed.

To Reproduce

Firstly, I tried to use the command "conda install -c conda-forge causalml" to install causalml, but I got the following problems.

Collecting package metadata (current_repodata.json): done Solving environment: failed with initial frozen solve. Retrying with flexible solve. Collecting package metadata (repodata.json): done Solving environment: failed with initial frozen solve. Retrying with flexible solve.

PackagesNotFoundError: The following packages are not available from current channels:

Current channels:

To search for alternate channels that may provide the conda package you're looking for, navigate to https://anaconda.org and use the search bar at the top of the page.

Then, I also tried to use "pip install causalml" to install causalml, however, I also got the following problems.

Collecting causalml Using cached causalml-0.14.0.tar.gz (899 kB) Installing build dependencies ... done Getting requirements to build wheel ... error ERROR: Command errored out with exit status 1: command: 'C:\Users\mingy\anaconda3\python.exe' 'C:\Users\mingy\anaconda3\lib\site-packages\pip_vendor\pep517\in_process_in_process.py' get_requires_for_build_wheel 'C:\Users\mingy\AppData\Local\Temp\tmp_hky96f9' cwd: C:\Users\mingy\AppData\Local\Temp\pip-install-cxcw_3iu\causalml_3b9aa5e49c2d4f1498ead2802147d9c4 Complete output (62 lines): warning: C:\Users\mingy\AppData\Local\Temp\pip-build-env-btt0d7e8\overlay\Lib\site-packages\sklearn\tree_tree.pxd:61:73: The keyword 'nogil' should appear at the end of the function signature line. Placing it before 'except' or 'noexcept' will be disallowed in a future version of Cython. warning: C:\Users\mingy\AppData\Local\Temp\pip-build-env-btt0d7e8\overlay\Lib\site-packages\sklearn\tree_tree.pxd:62:59: The keyword 'nogil' should appear at the end of the function signature line. Placing it before 'except' or 'noexcept' will be disallowed in a future version of Cython. warning: C:\Users\mingy\AppData\Local\Temp\pip-build-env-btt0d7e8\overlay\Lib\site-packages\sklearn\tree_tree.pxd:63:63: The keyword 'nogil' should appear at the end of the function signature line. Placing it before 'except' or 'noexcept' will be disallowed in a future version of Cython. warning: C:\Users\mingy\AppData\Local\Temp\pip-build-env-btt0d7e8\overlay\Lib\site-packages\sklearn\tree_splitter.pxd:84:72: The keyword 'nogil' should appear at the end of the function signature line. Placing it before 'except' or 'noexcept' will be disallowed in a future version of Cython. warning: C:\Users\mingy\AppData\Local\Temp\pip-build-env-btt0d7e8\overlay\Lib\site-packages\sklearn\tree_splitter.pxd:89:68: The keyword 'nogil' should appear at the end of the function signature line. Placing it before 'except' or 'noexcept' will be disallowed in a future version of Cython. warning: C:\Users\mingy\AppData\Local\Temp\pip-build-env-btt0d7e8\overlay\Lib\site-packages\sklearn\tree_criterion.pxd:57:45: The keyword 'nogil' should appear at the end of the function signature line. Placing it before 'except' or 'noexcept' will be disallowed in a future version of Cython. warning: C:\Users\mingy\AppData\Local\Temp\pip-build-env-btt0d7e8\overlay\Lib\site-packages\sklearn\tree_criterion.pxd:58:40: The keyword 'nogil' should appear at the end of the function signature line. Placing it before 'except' or 'noexcept' will be disallowed in a future version of Cython. warning: C:\Users\mingy\AppData\Local\Temp\pip-build-env-btt0d7e8\overlay\Lib\site-packages\sklearn\tree_criterion.pxd:59:48: The keyword 'nogil' should appear at the end of the function signature line. Placing it before 'except' or 'noexcept' will be disallowed in a future version of Cython. warning: C:\Users\mingy\AppData\Local\Temp\pip-build-env-btt0d7e8\overlay\Lib\site-packages\sklearn\tree_criterion.pxd:60:57: The keyword 'nogil' should appear at the end of the function signature line. Placing it before 'except' or 'noexcept' will be disallowed in a future version of Cython. warning: C:\Users\mingy\AppData\Local\Temp\pip-build-env-btt0d7e8\overlay\Lib\site-packages\sklearn\tree_utils.pxd:49:75: The keyword 'nogil' should appear at the end of the function signature line. Placing it before 'except' or 'noexcept' will be disallowed in a future version of Cython. warning: C:\Users\mingy\AppData\Local\Temp\pip-build-env-btt0d7e8\overlay\Lib\site-packages\sklearn\tree_utils.pxd:87:61: The keyword 'nogil' should appear at the end of the function signature line. Placing it before 'except' or 'noexcept' will be disallowed in a future version of Cython. warning: C:\Users\mingy\AppData\Local\Temp\pip-build-env-btt0d7e8\overlay\Lib\site-packages\sklearn\tree_utils.pxd:119:56: The keyword 'nogil' should appear at the end of the function signature line. Placing it before 'except' or 'noexcept' will be disallowed in a future version of Cython. warning: C:\Users\mingy\AppData\Local\Temp\pip-build-env-btt0d7e8\overlay\Lib\site-packages\sklearn\tree_utils.pxd:137:40: The keyword 'nogil' should appear at the end of the function signature line. Placing it before 'except' or 'noexcept' will be disallowed in a future version of Cython. warning: C:\Users\mingy\AppData\Local\Temp\pip-build-env-btt0d7e8\overlay\Lib\site-packages\sklearn\tree_utils.pxd:139:71: The keyword 'nogil' should appear at the end of the function signature line. Placing it before 'except' or 'noexcept' will be disallowed in a future version of Cython. warning: C:\Users\mingy\AppData\Local\Temp\pip-build-env-btt0d7e8\overlay\Lib\site-packages\sklearn\tree_utils.pxd:160:71: The keyword 'nogil' should appear at the end of the function signature line. Placing it before 'except' or 'noexcept' will be disallowed in a future version of Cython. warning: C:\Users\mingy\AppData\Local\Temp\pip-build-env-btt0d7e8\overlay\Lib\site-packages\sklearn\tree_utils.pxd:161:40: The keyword 'nogil' should appear at the end of the function signature line. Placing it before 'except' or 'noexcept' will be disallowed in a future version of Cython. warning: C:\Users\mingy\AppData\Local\Temp\pip-build-env-btt0d7e8\overlay\Lib\site-packages\sklearn\neighbors_quad_tree.pxd:72:59: The keyword 'nogil' should appear at the end of the function signature line. Placing it before 'except' or 'noexcept' will be disallowed in a future version of Cython. warning: C:\Users\mingy\AppData\Local\Temp\pip-build-env-btt0d7e8\overlay\Lib\site-packages\sklearn\neighbors_quad_tree.pxd:91:51: The keyword 'nogil' should appear at the end of the function signature line. Placing it before 'except' or 'noexcept' will be disallowed in a future version of Cython. warning: C:\Users\mingy\AppData\Local\Temp\pip-build-env-btt0d7e8\overlay\Lib\site-packages\sklearn\neighbors_quad_tree.pxd:94:59: The keyword 'nogil' should appear at the end of the function signature line. Placing it before 'except' or 'noexcept' will be disallowed in a future version of Cython. warning: C:\Users\mingy\AppData\Local\Temp\pip-build-env-btt0d7e8\overlay\Lib\site-packages\sklearn\neighbors_quad_tree.pxd:95:63: The keyword 'nogil' should appear at the end of the function signature line. Placing it before 'except' or 'noexcept' will be disallowed in a future version of Cython. warning: C:\Users\mingy\AppData\Local\Temp\pip-build-env-btt0d7e8\overlay\Lib\site-packages\sklearn\neighbors_quad_tree.pxd:96:80: The keyword 'nogil' should appear at the end of the function signature line. Placing it before 'except' or 'noexcept' will be disallowed in a future version of Cython. warning: causalml\inference\tree\causal_builder.pyx:185:71: The keyword 'nogil' should appear at the end of the function signature line. Placing it before 'except' or 'noexcept' will be disallowed in a future version of Cython. warning: causalml\inference\tree\causal_builder.pyx:331:76: The keyword 'nogil' should appear at the end of the function signature line. Placing it before 'except' or 'noexcept' will be disallowed in a future version of Cython.

Error compiling Cython file: Initial capacity cdef int init_capacity

if tree.max_depth <= 10: init_capacity = (2 ** (tree.max_depth + 1)) - 1

causalml\inference\tree\causal_builder.pyx:61:56: Cannot assign type 'double' to 'int' Compiling causalml/inference/tree/causal/_criterion.pyx because it changed. Compiling causalml/inference/tree/causal/_builder.pyx because it changed. Compiling causalml/inference/tree/uplift.pyx because it changed. [1/3] Cythonizing causalml/inference/tree/causal/_builder.pyx Traceback (most recent call last): File "C:\Users\mingy\anaconda3\lib\site-packages\pip_vendor\pep517\in_process_in_process.py", line 349, in main() File "C:\Users\mingy\anaconda3\lib\site-packages\pip_vendor\pep517\in_process_in_process.py", line 331, in main json_out['return_val'] = hook(*hook_input['kwargs']) File "C:\Users\mingy\anaconda3\lib\site-packages\pip_vendor\pep517\in_process_in_process.py", line 117, in get_requires_for_build_wheel return hook(config_settings) File "C:\Users\mingy\AppData\Local\Temp\pip-build-env-btt0d7e8\overlay\Lib\site-packages\setuptools\build_meta.py", line 355, in get_requires_for_build_wheel return self._get_build_requires(config_settings, requirements=['wheel']) File "C:\Users\mingy\AppData\Local\Temp\pip-build-env-btt0d7e8\overlay\Lib\site-packages\setuptools\build_meta.py", line 325, in _get_build_requires self.run_setup() File "C:\Users\mingy\AppData\Local\Temp\pip-build-env-btt0d7e8\overlay\Lib\site-packages\setuptools\build_meta.py", line 507, in run_setup super(_BuildMetaLegacyBackend, self).run_setup(setup_script=setup_script) File "C:\Users\mingy\AppData\Local\Temp\pip-build-env-btt0d7e8\overlay\Lib\site-packages\setuptools\build_meta.py", line 341, in run_setup exec(code, locals()) File "", line 46, in File "C:\Users\mingy\AppData\Local\Temp\pip-build-env-btt0d7e8\overlay\Lib\site-packages\Cython\Build\Dependencies.py", line 1134, in cythonize cythonize_one(args) File "C:\Users\mingy\AppData\Local\Temp\pip-build-env-btt0d7e8\overlay\Lib\site-packages\Cython\Build\Dependencies.py", line 1301, in cythonize_one raise CompileError(None, pyx_file) Cython.Compiler.Errors.CompileError: causalml/inference/tree/causal/_builder.pyx

WARNING: Discarding https://files.pythonhosted.org/packages/b5/da/6490afd3bb6e7c00e21050fbd6f1fc87ce7b3a0a5f6fb08ebde20a1f62b1/causalml-0.14.0.tar.gz#sha256=44145ac0ae13515bfe7e649fce100d197426dcbfd8fb0461ff38839285cdc7f4 (from https://pypi.org/simple/causalml/) (requires-python:>=3.7). Command errored out with exit status 1: 'C:\Users\mingy\anaconda3\python.exe' 'C:\Users\mingy\anaconda3\lib\site-packages\pip_vendor\pep517\in_process_in_process.py' get_requires_for_build_wheel 'C:\Users\mingy\AppData\Local\Temp\tmp_hky96f9' Check the logs for full command output. Using cached causalml-0.13.0.tar.gz (535 kB) Requirement already satisfied: setuptools>=41.0.0 in c:\users\mingy\anaconda3\lib\site-packages (from causalml) (61.2.0) Requirement already satisfied: forestci==0.6 in c:\users\mingy\anaconda3\lib\site-packages (from causalml) (0.6) Requirement already satisfied: pathos==0.2.9 in c:\users\mingy\anaconda3\lib\site-packages (from causalml) (0.2.9) Requirement already satisfied: pip>=10.0 in c:\users\mingy\anaconda3\lib\site-packages (from causalml) (21.2.4) Requirement already satisfied: numpy>=1.18.5 in c:\users\mingy\anaconda3\lib\site-packages (from causalml) (1.22.4) Requirement already satisfied: scipy>=1.4.1 in c:\users\mingy\anaconda3\lib\site-packages (from causalml) (1.7.3) Requirement already satisfied: matplotlib in c:\users\mingy\anaconda3\lib\site-packages (from causalml) (3.5.1) Requirement already satisfied: pandas>=0.24.1 in c:\users\mingy\anaconda3\lib\site-packages (from causalml) (1.4.2) Requirement already satisfied: scikit-learn==1.0.2 in c:\users\mingy\anaconda3\lib\site-packages (from causalml) (1.0.2) Requirement already satisfied: statsmodels>=0.9.0 in c:\users\mingy\anaconda3\lib\site-packages (from causalml) (0.13.2) Requirement already satisfied: seaborn in c:\users\mingy\anaconda3\lib\site-packages (from causalml) (0.11.2) Requirement already satisfied: Cython>=0.28.0 in c:\users\mingy\anaconda3\lib\site-packages (from causalml) (0.29.28) Requirement already satisfied: xgboost in c:\users\mingy\anaconda3\lib\site-packages (from causalml) (1.7.6) Requirement already satisfied: pydotplus in c:\users\mingy\anaconda3\lib\site-packages (from causalml) (2.0.2) Requirement already satisfied: tqdm in c:\users\mingy\anaconda3\lib\site-packages (from causalml) (4.64.0) Requirement already satisfied: shap in c:\users\mingy\anaconda3\lib\site-packages (from causalml) (0.42.1) Requirement already satisfied: dill in c:\users\mingy\anaconda3\lib\site-packages (from causalml) (0.3.7) Requirement already satisfied: lightgbm in c:\users\mingy\anaconda3\lib\site-packages (from causalml) (4.0.0) Requirement already satisfied: pygam in c:\users\mingy\anaconda3\lib\site-packages (from causalml) (0.8.0) Requirement already satisfied: packaging in c:\users\mingy\anaconda3\lib\site-packages (from causalml) (21.3) Requirement already satisfied: torch in c:\users\mingy\anaconda3\lib\site-packages (from causalml) (1.13.1) Requirement already satisfied: pyro-ppl in c:\users\mingy\anaconda3\lib\site-packages (from causalml) (1.8.6) Requirement already satisfied: graphviz in c:\users\mingy\anaconda3\lib\site-packages (from causalml) (0.20.1) Requirement already satisfied: multiprocess>=0.70.13 in c:\users\mingy\anaconda3\lib\site-packages (from pathos==0.2.9->causalml) (0.70.15) Requirement already satisfied: pox>=0.3.1 in c:\users\mingy\anaconda3\lib\site-packages (from pathos==0.2.9->causalml) (0.3.3) Requirement already satisfied: ppft>=1.7.6.5 in c:\users\mingy\anaconda3\lib\site-packages (from pathos==0.2.9->causalml) (1.7.6.7) Requirement already satisfied: threadpoolctl>=2.0.0 in c:\users\mingy\anaconda3\lib\site-packages (from scikit-learn==1.0.2->causalml) (2.2.0) Requirement already satisfied: joblib>=0.11 in c:\users\mingy\anaconda3\lib\site-packages (from scikit-learn==1.0.2->causalml) (1.1.0) Requirement already satisfied: pytz>=2020.1 in c:\users\mingy\anaconda3\lib\site-packages (from pandas>=0.24.1->causalml) (2021.3) Requirement already satisfied: python-dateutil>=2.8.1 in c:\users\mingy\anaconda3\lib\site-packages (from pandas>=0.24.1->causalml) (2.8.2) Requirement already satisfied: six>=1.5 in c:\users\mingy\anaconda3\lib\site-packages (from python-dateutil>=2.8.1->pandas>=0.24.1->causalml) (1.16.0) Requirement already satisfied: patsy>=0.5.2 in c:\users\mingy\anaconda3\lib\site-packages (from statsmodels>=0.9.0->causalml) (0.5.2) Requirement already satisfied: pyparsing!=3.0.5,>=2.0.2 in c:\users\mingy\anaconda3\lib\site-packages (from packaging->causalml) (3.0.4) Requirement already satisfied: kiwisolver>=1.0.1 in c:\users\mingy\anaconda3\lib\site-packages (from matplotlib->causalml) (1.3.2) Requirement already satisfied: cycler>=0.10 in c:\users\mingy\anaconda3\lib\site-packages (from matplotlib->causalml) (0.11.0) Requirement already satisfied: pillow>=6.2.0 in c:\users\mingy\anaconda3\lib\site-packages (from matplotlib->causalml) (9.0.1) Requirement already satisfied: fonttools>=4.22.0 in c:\users\mingy\anaconda3\lib\site-packages (from matplotlib->causalml) (4.25.0) Requirement already satisfied: future in c:\users\mingy\anaconda3\lib\site-packages (from pygam->causalml) (0.18.2) Requirement already satisfied: progressbar2 in c:\users\mingy\anaconda3\lib\site-packages (from pygam->causalml) (4.2.0) Requirement already satisfied: python-utils>=3.0.0 in c:\users\mingy\anaconda3\lib\site-packages (from progressbar2->pygam->causalml) (3.4.5) Requirement already satisfied: opt-einsum>=2.3.2 in c:\users\mingy\anaconda3\lib\site-packages (from pyro-ppl->causalml) (3.3.0) Requirement already satisfied: pyro-api>=0.1.1 in c:\users\mingy\anaconda3\lib\site-packages (from pyro-ppl->causalml) (0.1.2) Requirement already satisfied: typing-extensions in c:\users\mingy\anaconda3\lib\site-packages (from torch->causalml) (4.1.1) Requirement already satisfied: colorama in c:\users\mingy\anaconda3\lib\site-packages (from tqdm->causalml) (0.4.4) Requirement already satisfied: cloudpickle in c:\users\mingy\anaconda3\lib\site-packages (from shap->causalml) (2.0.0) Requirement already satisfied: numba in c:\users\mingy\anaconda3\lib\site-packages (from shap->causalml) (0.55.1) Requirement already satisfied: slicer==0.0.7 in c:\users\mingy\anaconda3\lib\site-packages (from shap->causalml) (0.0.7) Requirement already satisfied: llvmlite<0.39,>=0.38.0rc1 in c:\users\mingy\anaconda3\lib\site-packages (from numba->shap->causalml) (0.38.0) Collecting numpy>=1.18.5 Using cached numpy-1.21.6-cp39-cp39-win_amd64.whl (14.0 MB) Building wheels for collected packages: causalml Building wheel for causalml (setup.py) ... error ERROR: Command errored out with exit status 1: command: 'C:\Users\mingy\anaconda3\python.exe' -u -c 'import io, os, sys, setuptools, tokenize; sys.argv[0] = '"'"'C:\Users\mingy\AppData\Local\Temp\pip-install-cxcw_3iu\causalml_bcbb13866fcc4698ae46eec16b5263b3\setup.py'"'"'; file='"'"'C:\Users\mingy\AppData\Local\Temp\pip-install-cxcw_3iu\causalml_bcbb13866fcc4698ae46eec16b5263b3\setup.py'"'"';f = getattr(tokenize, '"'"'open'"'"', open)(file) if os.path.exists(file) else io.StringIO('"'"'from setuptools import setup; setup()'"'"');code = f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, file, '"'"'exec'"'"'))' bdist_wheel -d 'C:\Users\mingy\AppData\Local\Temp\pip-wheel-tg_sg_h0' cwd: C:\Users\mingy\AppData\Local\Temp\pip-install-cxcw_3iu\causalml_bcbb13866fcc4698ae46eec16b5263b3\ Complete output (67 lines): running bdist_wheel running build running build_py creating build creating build\lib.win-amd64-3.9 creating build\lib.win-amd64-3.9\causalml copying causalml\features.py -> build\lib.win-amd64-3.9\causalml copying causalml\match.py -> build\lib.win-amd64-3.9\causalml copying causalml\propensity.py -> build\lib.win-amd64-3.9\causalml copying causalml__init.py -> build\lib.win-amd64-3.9\causalml creating build\lib.win-amd64-3.9\causalml\dataset copying causalml\dataset\classification.py -> build\lib.win-amd64-3.9\causalml\dataset copying causalml\dataset\regression.py -> build\lib.win-amd64-3.9\causalml\dataset copying causalml\dataset\synthetic.py -> build\lib.win-amd64-3.9\causalml\dataset copying causalml\dataset__init.py -> build\lib.win-amd64-3.9\causalml\dataset creating build\lib.win-amd64-3.9\causalml\feature_selection copying causalml\feature_selection\filters.py -> build\lib.win-amd64-3.9\causalml\feature_selection copying causalml\feature_selection__init__.py -> build\lib.win-amd64-3.9\causalml\feature_selection creating build\lib.win-amd64-3.9\causalml\inference copying causalml\inference__init.py -> build\lib.win-amd64-3.9\causalml\inference creating build\lib.win-amd64-3.9\causalml\metrics copying causalml\metrics\classification.py -> build\lib.win-amd64-3.9\causalml\metrics copying causalml\metrics\const.py -> build\lib.win-amd64-3.9\causalml\metrics copying causalml\metrics\regression.py -> build\lib.win-amd64-3.9\causalml\metrics copying causalml\metrics\sensitivity.py -> build\lib.win-amd64-3.9\causalml\metrics copying causalml\metrics\visualize.py -> build\lib.win-amd64-3.9\causalml\metrics copying causalml\metrics\init.py -> build\lib.win-amd64-3.9\causalml\metrics creating build\lib.win-amd64-3.9\causalml\optimize copying causalml\optimize\pns.py -> build\lib.win-amd64-3.9\causalml\optimize copying causalml\optimize\policylearner.py -> build\lib.win-amd64-3.9\causalml\optimize copying causalml\optimize\unit_selection.py -> build\lib.win-amd64-3.9\causalml\optimize copying causalml\optimize\utils.py -> build\lib.win-amd64-3.9\causalml\optimize copying causalml\optimize\value_optimization.py -> build\lib.win-amd64-3.9\causalml\optimize copying causalml\optimize\init__.py -> build\lib.win-amd64-3.9\causalml\optimize creating build\lib.win-amd64-3.9\causalml\inference\iv copying causalml\inference\iv\drivlearner.py -> build\lib.win-amd64-3.9\causalml\inference\iv copying causalml\inference\iv\iv_regression.py -> build\lib.win-amd64-3.9\causalml\inference\iv copying causalml\inference\iv\init.py -> build\lib.win-amd64-3.9\causalml\inference\iv creating build\lib.win-amd64-3.9\causalml\inference\meta copying causalml\inference\meta\base.py -> build\lib.win-amd64-3.9\causalml\inference\meta copying causalml\inference\meta\drlearner.py -> build\lib.win-amd64-3.9\causalml\inference\meta copying causalml\inference\meta\explainer.py -> build\lib.win-amd64-3.9\causalml\inference\meta copying causalml\inference\meta\rlearner.py -> build\lib.win-amd64-3.9\causalml\inference\meta copying causalml\inference\meta\slearner.py -> build\lib.win-amd64-3.9\causalml\inference\meta copying causalml\inference\meta\tlearner.py -> build\lib.win-amd64-3.9\causalml\inference\meta copying causalml\inference\meta\tmle.py -> build\lib.win-amd64-3.9\causalml\inference\meta copying causalml\inference\meta\utils.py -> build\lib.win-amd64-3.9\causalml\inference\meta copying causalml\inference\meta\xlearner.py -> build\lib.win-amd64-3.9\causalml\inference\meta copying causalml\inference\meta\init.py -> build\lib.win-amd64-3.9\causalml\inference\meta creating build\lib.win-amd64-3.9\causalml\inference\nn copying causalml\inference\nn\cevae.py -> build\lib.win-amd64-3.9\causalml\inference\nn copying causalml\inference\nn\init.py -> build\lib.win-amd64-3.9\causalml\inference\nn creating build\lib.win-amd64-3.9\causalml\inference\tf copying causalml\inference\tf\dragonnet.py -> build\lib.win-amd64-3.9\causalml\inference\tf copying causalml\inference\tf\utils.py -> build\lib.win-amd64-3.9\causalml\inference\tf copying causalml\inference\tf\init.py -> build\lib.win-amd64-3.9\causalml\inference\tf creating build\lib.win-amd64-3.9\causalml\inference\tree copying causalml\inference\tree\plot.py -> build\lib.win-amd64-3.9\causalml\inference\tree copying causalml\inference\tree\utils.py -> build\lib.win-amd64-3.9\causalml\inference\tree copying causalml\inference\tree\init__.py -> build\lib.win-amd64-3.9\causalml\inference\tree creating build\lib.win-amd64-3.9\causalml\inference\tree\causal copying causalml\inference\tree\causal\causaltree.py -> build\lib.win-amd64-3.9\causalml\inference\tree\causal copying causalml\inference\tree\causal_tree.py -> build\lib.win-amd64-3.9\causalml\inference\tree\causal copying causalml\inference\tree\causal\init__.py -> build\lib.win-amd64-3.9\causalml\inference\tree\causal running build_ext building 'causalml.inference.tree.causal.criterion' extension error: Microsoft Visual C++ 14.0 or greater is required. Get it with "Microsoft C++ Build Tools": https://visualstudio.microsoft.com/visual-cpp-build-tools/

ERROR: Failed building wheel for causalml Running setup.py clean for causalml Failed to build causalml Installing collected packages: numpy, causalml Attempting uninstall: numpy Found existing installation: numpy 1.22.4 Uninstalling numpy-1.22.4: Successfully uninstalled numpy-1.22.4 Running setup.py install for causalml ... error ERROR: Command errored out with exit status 1: command: 'C:\Users\mingy\anaconda3\python.exe' -u -c 'import io, os, sys, setuptools, tokenize; sys.argv[0] = '"'"'C:\Users\mingy\AppData\Local\Temp\pip-install-cxcw_3iu\causalml_bcbb13866fcc4698ae46eec16b5263b3\setup.py'"'"'; file='"'"'C:\Users\mingy\AppData\Local\Temp\pip-install-cxcw_3iu\causalml_bcbb13866fcc4698ae46eec16b5263b3\setup.py'"'"';f = getattr(tokenize, '"'"'open'"'"', open)(file) if os.path.exists(file) else io.StringIO('"'"'from setuptools import setup; setup()'"'"');code = f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, file, '"'"'exec'"'"'))' install --record 'C:\Users\mingy\AppData\Local\Temp\pip-record-siyjyfam\install-record.txt' --single-version-externally-managed --compile --install-headers 'C:\Users\mingy\anaconda3\Include\causalml' cwd: C:\Users\mingy\AppData\Local\Temp\pip-install-cxcw_3iu\causalml_bcbb13866fcc4698ae46eec16b5263b3\ Complete output (77 lines): Compiling causalml/inference/tree/causal/criterion.pyx because it depends on C:\Users\mingy\anaconda3\lib\site-packages\numpy__init.pxd. Compiling causalml/inference/tree/causal/builder.pyx because it depends on C:\Users\mingy\anaconda3\lib\site-packages\numpy__init.pxd. Compiling causalml/inference/tree/uplift.pyx because it depends on C:\Users\mingy\anaconda3\lib\site-packages\numpy__init.pxd. [1/3] Cythonizing causalml/inference/tree/causal/builder.pyx [2/3] Cythonizing causalml/inference/tree/uplift.pyx C:\Users\mingy\anaconda3\lib\site-packages\Cython\Compiler\Main.py:369: FutureWarning: Cython directive 'language_level' not set, using 2 for now (Py2). This will change in a later release! File: C:\Users\mingy\AppData\Local\Temp\pip-install-cxcw_3iu\causalml_bcbb13866fcc4698ae46eec16b5263b3\causalml\inference\tree\uplift.pyx tree = Parsing.p_module(s, pxd, full_module_name) [3/3] Cythonizing causalml/inference/tree/causal/criterion.pyx running install C:\Users\mingy\anaconda3\lib\site-packages\setuptools\command\install.py:34: SetuptoolsDeprecationWarning: setup.py install is deprecated. Use build and pip and other standards-based tools. warnings.warn( running build running build_py creating build creating build\lib.win-amd64-3.9 creating build\lib.win-amd64-3.9\causalml copying causalml\features.py -> build\lib.win-amd64-3.9\causalml copying causalml\match.py -> build\lib.win-amd64-3.9\causalml copying causalml\propensity.py -> build\lib.win-amd64-3.9\causalml copying causalml__init.py -> build\lib.win-amd64-3.9\causalml creating build\lib.win-amd64-3.9\causalml\dataset copying causalml\dataset\classification.py -> build\lib.win-amd64-3.9\causalml\dataset copying causalml\dataset\regression.py -> build\lib.win-amd64-3.9\causalml\dataset copying causalml\dataset\synthetic.py -> build\lib.win-amd64-3.9\causalml\dataset copying causalml\dataset\init.py -> build\lib.win-amd64-3.9\causalml\dataset creating build\lib.win-amd64-3.9\causalml\feature_selection copying causalml\feature_selection\filters.py -> build\lib.win-amd64-3.9\causalml\feature_selection copying causalml\feature_selection\init__.py -> build\lib.win-amd64-3.9\causalml\feature_selection creating build\lib.win-amd64-3.9\causalml\inference copying causalml\inference\init.py -> build\lib.win-amd64-3.9\causalml\inference creating build\lib.win-amd64-3.9\causalml\metrics copying causalml\metrics\classification.py -> build\lib.win-amd64-3.9\causalml\metrics copying causalml\metrics\const.py -> build\lib.win-amd64-3.9\causalml\metrics copying causalml\metrics\regression.py -> build\lib.win-amd64-3.9\causalml\metrics copying causalml\metrics\sensitivity.py -> build\lib.win-amd64-3.9\causalml\metrics copying causalml\metrics\visualize.py -> build\lib.win-amd64-3.9\causalml\metrics copying causalml\metrics\init.py -> build\lib.win-amd64-3.9\causalml\metrics creating build\lib.win-amd64-3.9\causalml\optimize copying causalml\optimize\pns.py -> build\lib.win-amd64-3.9\causalml\optimize copying causalml\optimize\policylearner.py -> build\lib.win-amd64-3.9\causalml\optimize copying causalml\optimize\unit_selection.py -> build\lib.win-amd64-3.9\causalml\optimize copying causalml\optimize\utils.py -> build\lib.win-amd64-3.9\causalml\optimize copying causalml\optimize\value_optimization.py -> build\lib.win-amd64-3.9\causalml\optimize copying causalml\optimize\init__.py -> build\lib.win-amd64-3.9\causalml\optimize creating build\lib.win-amd64-3.9\causalml\inference\iv copying causalml\inference\iv\drivlearner.py -> build\lib.win-amd64-3.9\causalml\inference\iv copying causalml\inference\iv\iv_regression.py -> build\lib.win-amd64-3.9\causalml\inference\iv copying causalml\inference\iv\init.py -> build\lib.win-amd64-3.9\causalml\inference\iv creating build\lib.win-amd64-3.9\causalml\inference\meta copying causalml\inference\meta\base.py -> build\lib.win-amd64-3.9\causalml\inference\meta copying causalml\inference\meta\drlearner.py -> build\lib.win-amd64-3.9\causalml\inference\meta copying causalml\inference\meta\explainer.py -> build\lib.win-amd64-3.9\causalml\inference\meta copying causalml\inference\meta\rlearner.py -> build\lib.win-amd64-3.9\causalml\inference\meta copying causalml\inference\meta\slearner.py -> build\lib.win-amd64-3.9\causalml\inference\meta copying causalml\inference\meta\tlearner.py -> build\lib.win-amd64-3.9\causalml\inference\meta copying causalml\inference\meta\tmle.py -> build\lib.win-amd64-3.9\causalml\inference\meta copying causalml\inference\meta\utils.py -> build\lib.win-amd64-3.9\causalml\inference\meta copying causalml\inference\meta\xlearner.py -> build\lib.win-amd64-3.9\causalml\inference\meta copying causalml\inference\meta\init.py -> build\lib.win-amd64-3.9\causalml\inference\meta creating build\lib.win-amd64-3.9\causalml\inference\nn copying causalml\inference\nn\cevae.py -> build\lib.win-amd64-3.9\causalml\inference\nn copying causalml\inference\nn\init.py -> build\lib.win-amd64-3.9\causalml\inference\nn creating build\lib.win-amd64-3.9\causalml\inference\tf copying causalml\inference\tf\dragonnet.py -> build\lib.win-amd64-3.9\causalml\inference\tf copying causalml\inference\tf\utils.py -> build\lib.win-amd64-3.9\causalml\inference\tf copying causalml\inference\tf\init.py -> build\lib.win-amd64-3.9\causalml\inference\tf creating build\lib.win-amd64-3.9\causalml\inference\tree copying causalml\inference\tree\plot.py -> build\lib.win-amd64-3.9\causalml\inference\tree copying causalml\inference\tree\utils.py -> build\lib.win-amd64-3.9\causalml\inference\tree copying causalml\inference\tree\init__.py -> build\lib.win-amd64-3.9\causalml\inference\tree creating build\lib.win-amd64-3.9\causalml\inference\tree\causal copying causalml\inference\tree\causal\causaltree.py -> build\lib.win-amd64-3.9\causalml\inference\tree\causal copying causalml\inference\tree\causal_tree.py -> build\lib.win-amd64-3.9\causalml\inference\tree\causal copying causalml\inference\tree\causal\init__.py -> build\lib.win-amd64-3.9\causalml\inference\tree\causal running build_ext building 'causalml.inference.tree.causal.criterion' extension error: Microsoft Visual C++ 14.0 or greater is required. Get it with "Microsoft C++ Build Tools": https://visualstudio.microsoft.com/visual-cpp-build-tools/

ERROR: Command errored out with exit status 1: 'C:\Users\mingy\anaconda3\python.exe' -u -c 'import io, os, sys, setuptools, tokenize; sys.argv[0] = '"'"'C:\Users\mingy\AppData\Local\Temp\pip-install-cxcw_3iu\causalml_bcbb13866fcc4698ae46eec16b5263b3\setup.py'"'"'; file='"'"'C:\Users\mingy\AppData\Local\Temp\pip-install-cxcw_3iu\causalml_bcbb13866fcc4698ae46eec16b5263b3\setup.py'"'"';f = getattr(tokenize, '"'"'open'"'"', open)(file) if os.path.exists(file) else io.StringIO('"'"'from setuptools import setup; setup()'"'"');code = f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, file, '"'"'exec'"'"'))' install --record 'C:\Users\mingy\AppData\Local\Temp\pip-record-siyjyfam\install-record.txt' --single-version-externally-managed --compile --install-headers 'C:\Users\mingy\anaconda3\Include\causalml' Check the logs for full command output.

Expected behavior I would like to know what is the problem here and what I should do to properly install causalml.

Environment (please complete the following information):

jeongyoonlee commented 1 year ago

Hi @MingyueHe.

Can you try conda and pip installation again? We released v0.14.1 yesterday with fixes in dependencies, and @pavelzw just pushed the changes to conda-forge today (see PR).

MingyueHe commented 1 year ago

Hi @jeongyoonlee,

Thank you for replying.

I tried to use conda and pip installation again. However, I have the same problem.

For conda installation:

Retrieving notices: ...working... done Collecting package metadata (current_repodata.json): done Solving environment: failed with initial frozen solve. Retrying with flexible solve. Collecting package metadata (repodata.json): done Solving environment: failed with initial frozen solve. Retrying with flexible solve.

PackagesNotFoundError: The following packages are not available from current channels:

Current channels:

To search for alternate channels that may provide the conda package you're looking for, navigate to https://anaconda.org and use the search bar at the top of the page.

For pip installation:

Collecting causalml Downloading causalml-0.14.1.tar.gz (909 kB) |████████████████████████████████| 909 kB 3.3 MB/s Installing build dependencies ... done Getting requirements to build wheel ... done Preparing wheel metadata ... done Requirement already satisfied: shap in c:\users\mingy\anaconda3\lib\site-packages (from causalml) (0.42.1) Requirement already satisfied: pyro-ppl in c:\users\mingy\anaconda3\lib\site-packages (from causalml) (1.8.6) Requirement already satisfied: tqdm in c:\users\mingy\anaconda3\lib\site-packages (from causalml) (4.64.0) Requirement already satisfied: forestci==0.6 in c:\users\mingy\anaconda3\lib\site-packages (from causalml) (0.6) Requirement already satisfied: lightgbm in c:\users\mingy\anaconda3\lib\site-packages (from causalml) (4.0.0) Requirement already satisfied: graphviz in c:\users\mingy\anaconda3\lib\site-packages (from causalml) (0.20.1) Requirement already satisfied: statsmodels>=0.9.0 in c:\users\mingy\anaconda3\lib\site-packages (from causalml) (0.13.2) Requirement already satisfied: xgboost in c:\users\mingy\anaconda3\lib\site-packages (from causalml) (1.7.6) Requirement already satisfied: numpy<1.24 in c:\users\mingy\anaconda3\lib\site-packages (from causalml) (1.21.6) Requirement already satisfied: pathos==0.2.9 in c:\users\mingy\anaconda3\lib\site-packages (from causalml) (0.2.9) Requirement already satisfied: matplotlib in c:\users\mingy\anaconda3\lib\site-packages (from causalml) (3.5.1) Requirement already satisfied: torch in c:\users\mingy\anaconda3\lib\site-packages (from causalml) (1.13.1) Requirement already satisfied: scipy>=1.4.1 in c:\users\mingy\anaconda3\lib\site-packages (from causalml) (1.7.3) Requirement already satisfied: pygam in c:\users\mingy\anaconda3\lib\site-packages (from causalml) (0.8.0) Requirement already satisfied: pydotplus in c:\users\mingy\anaconda3\lib\site-packages (from causalml) (2.0.2) Requirement already satisfied: Cython<=0.29.34 in c:\users\mingy\anaconda3\lib\site-packages (from causalml) (0.29.28) Requirement already satisfied: pip>=10.0 in c:\users\mingy\anaconda3\lib\site-packages (from causalml) (21.2.4) Requirement already satisfied: packaging in c:\users\mingy\anaconda3\lib\site-packages (from causalml) (21.3) Collecting pandas<1.4.0,>=0.24.1 Downloading pandas-1.3.5-cp39-cp39-win_amd64.whl (10.2 MB) |████████████████████████████████| 10.2 MB 3.3 MB/s Requirement already satisfied: dill in c:\users\mingy\anaconda3\lib\site-packages (from causalml) (0.3.7) Requirement already satisfied: scikit-learn<=1.0.2 in c:\users\mingy\anaconda3\lib\site-packages (from causalml) (1.0.2) Requirement already satisfied: seaborn in c:\users\mingy\anaconda3\lib\site-packages (from causalml) (0.11.2) Requirement already satisfied: pox>=0.3.1 in c:\users\mingy\anaconda3\lib\site-packages (from pathos==0.2.9->causalml) (0.3.3) Requirement already satisfied: multiprocess>=0.70.13 in c:\users\mingy\anaconda3\lib\site-packages (from pathos==0.2.9->causalml) (0.70.15) Requirement already satisfied: ppft>=1.7.6.5 in c:\users\mingy\anaconda3\lib\site-packages (from pathos==0.2.9->causalml) (1.7.6.7) Requirement already satisfied: python-dateutil>=2.7.3 in c:\users\mingy\anaconda3\lib\site-packages (from pandas<1.4.0,>=0.24.1->causalml) (2.8.2) Requirement already satisfied: pytz>=2017.3 in c:\users\mingy\anaconda3\lib\site-packages (from pandas<1.4.0,>=0.24.1->causalml) (2021.3) Requirement already satisfied: six>=1.5 in c:\users\mingy\anaconda3\lib\site-packages (from python-dateutil>=2.7.3->pandas<1.4.0,>=0.24.1->causalml) (1.16.0) Requirement already satisfied: joblib>=0.11 in c:\users\mingy\anaconda3\lib\site-packages (from scikit-learn<=1.0.2->causalml) (1.1.0) Requirement already satisfied: threadpoolctl>=2.0.0 in c:\users\mingy\anaconda3\lib\site-packages (from scikit-learn<=1.0.2->causalml) (2.2.0) Requirement already satisfied: patsy>=0.5.2 in c:\users\mingy\anaconda3\lib\site-packages (from statsmodels>=0.9.0->causalml) (0.5.2) Requirement already satisfied: pyparsing!=3.0.5,>=2.0.2 in c:\users\mingy\anaconda3\lib\site-packages (from packaging->causalml) (3.0.4) Requirement already satisfied: kiwisolver>=1.0.1 in c:\users\mingy\anaconda3\lib\site-packages (from matplotlib->causalml) (1.3.2) Requirement already satisfied: fonttools>=4.22.0 in c:\users\mingy\anaconda3\lib\site-packages (from matplotlib->causalml) (4.25.0) Requirement already satisfied: pillow>=6.2.0 in c:\users\mingy\anaconda3\lib\site-packages (from matplotlib->causalml) (9.0.1) Requirement already satisfied: cycler>=0.10 in c:\users\mingy\anaconda3\lib\site-packages (from matplotlib->causalml) (0.11.0) Requirement already satisfied: progressbar2 in c:\users\mingy\anaconda3\lib\site-packages (from pygam->causalml) (4.2.0) Requirement already satisfied: future in c:\users\mingy\anaconda3\lib\site-packages (from pygam->causalml) (0.18.2) Requirement already satisfied: python-utils>=3.0.0 in c:\users\mingy\anaconda3\lib\site-packages (from progressbar2->pygam->causalml) (3.4.5) Requirement already satisfied: opt-einsum>=2.3.2 in c:\users\mingy\anaconda3\lib\site-packages (from pyro-ppl->causalml) (3.3.0) Requirement already satisfied: pyro-api>=0.1.1 in c:\users\mingy\anaconda3\lib\site-packages (from pyro-ppl->causalml) (0.1.2) Requirement already satisfied: typing-extensions in c:\users\mingy\anaconda3\lib\site-packages (from torch->causalml) (4.1.1) Requirement already satisfied: colorama in c:\users\mingy\anaconda3\lib\site-packages (from tqdm->causalml) (0.4.4) Requirement already satisfied: slicer==0.0.7 in c:\users\mingy\anaconda3\lib\site-packages (from shap->causalml) (0.0.7) Requirement already satisfied: cloudpickle in c:\users\mingy\anaconda3\lib\site-packages (from shap->causalml) (2.0.0) Requirement already satisfied: numba in c:\users\mingy\anaconda3\lib\site-packages (from shap->causalml) (0.55.1) Requirement already satisfied: setuptools in c:\users\mingy\anaconda3\lib\site-packages (from numba->shap->causalml) (61.2.0) Requirement already satisfied: llvmlite<0.39,>=0.38.0rc1 in c:\users\mingy\anaconda3\lib\site-packages (from numba->shap->causalml) (0.38.0) Building wheels for collected packages: causalml Building wheel for causalml (PEP 517) ... error ERROR: Command errored out with exit status 1: command: 'C:\Users\mingy\anaconda3\python.exe' 'C:\Users\mingy\anaconda3\lib\site-packages\pip_vendor\pep517\in_process_in_process.py' build_wheel 'C:\Users\mingy\AppData\Local\Temp\tmpjxa0xagd' cwd: C:\Users\mingy\AppData\Local\Temp\pip-install-woqzy2yg\causalml_5d3768c017ef42e38cc0bbaba3041d19 Complete output (181 lines): running bdist_wheel running build running build_py creating build creating build\lib.win-amd64-cpython-39 creating build\lib.win-amd64-cpython-39\causalml copying causalml\features.py -> build\lib.win-amd64-cpython-39\causalml copying causalml\match.py -> build\lib.win-amd64-cpython-39\causalml copying causalml\propensity.py -> build\lib.win-amd64-cpython-39\causalml copying causalml__init.py -> build\lib.win-amd64-cpython-39\causalml creating build\lib.win-amd64-cpython-39\causalml\dataset copying causalml\dataset\classification.py -> build\lib.win-amd64-cpython-39\causalml\dataset copying causalml\dataset\regression.py -> build\lib.win-amd64-cpython-39\causalml\dataset copying causalml\dataset\synthetic.py -> build\lib.win-amd64-cpython-39\causalml\dataset copying causalml\dataset__init.py -> build\lib.win-amd64-cpython-39\causalml\dataset creating build\lib.win-amd64-cpython-39\causalml\feature_selection copying causalml\feature_selection\filters.py -> build\lib.win-amd64-cpython-39\causalml\feature_selection copying causalml\feature_selection__init__.py -> build\lib.win-amd64-cpython-39\causalml\feature_selection creating build\lib.win-amd64-cpython-39\causalml\inference copying causalml\inference__init.py -> build\lib.win-amd64-cpython-39\causalml\inference creating build\lib.win-amd64-cpython-39\causalml\metrics copying causalml\metrics\classification.py -> build\lib.win-amd64-cpython-39\causalml\metrics copying causalml\metrics\const.py -> build\lib.win-amd64-cpython-39\causalml\metrics copying causalml\metrics\regression.py -> build\lib.win-amd64-cpython-39\causalml\metrics copying causalml\metrics\sensitivity.py -> build\lib.win-amd64-cpython-39\causalml\metrics copying causalml\metrics\visualize.py -> build\lib.win-amd64-cpython-39\causalml\metrics copying causalml\metrics\init.py -> build\lib.win-amd64-cpython-39\causalml\metrics creating build\lib.win-amd64-cpython-39\causalml\optimize copying causalml\optimize\pns.py -> build\lib.win-amd64-cpython-39\causalml\optimize copying causalml\optimize\policylearner.py -> build\lib.win-amd64-cpython-39\causalml\optimize copying causalml\optimize\unit_selection.py -> build\lib.win-amd64-cpython-39\causalml\optimize copying causalml\optimize\utils.py -> build\lib.win-amd64-cpython-39\causalml\optimize copying causalml\optimize\value_optimization.py -> build\lib.win-amd64-cpython-39\causalml\optimize copying causalml\optimize\init__.py -> build\lib.win-amd64-cpython-39\causalml\optimize creating build\lib.win-amd64-cpython-39\causalml\inference\iv copying causalml\inference\iv\drivlearner.py -> build\lib.win-amd64-cpython-39\causalml\inference\iv copying causalml\inference\iv\iv_regression.py -> build\lib.win-amd64-cpython-39\causalml\inference\iv copying causalml\inference\iv\init.py -> build\lib.win-amd64-cpython-39\causalml\inference\iv creating build\lib.win-amd64-cpython-39\causalml\inference\meta copying causalml\inference\meta\base.py -> build\lib.win-amd64-cpython-39\causalml\inference\meta copying causalml\inference\meta\drlearner.py -> build\lib.win-amd64-cpython-39\causalml\inference\meta copying causalml\inference\meta\explainer.py -> build\lib.win-amd64-cpython-39\causalml\inference\meta copying causalml\inference\meta\rlearner.py -> build\lib.win-amd64-cpython-39\causalml\inference\meta copying causalml\inference\meta\slearner.py -> build\lib.win-amd64-cpython-39\causalml\inference\meta copying causalml\inference\meta\tlearner.py -> build\lib.win-amd64-cpython-39\causalml\inference\meta copying causalml\inference\meta\tmle.py -> build\lib.win-amd64-cpython-39\causalml\inference\meta copying causalml\inference\meta\utils.py -> build\lib.win-amd64-cpython-39\causalml\inference\meta copying causalml\inference\meta\xlearner.py -> build\lib.win-amd64-cpython-39\causalml\inference\meta copying causalml\inference\meta\init.py -> build\lib.win-amd64-cpython-39\causalml\inference\meta creating build\lib.win-amd64-cpython-39\causalml\inference\nn copying causalml\inference\nn\cevae.py -> build\lib.win-amd64-cpython-39\causalml\inference\nn copying causalml\inference\nn\init.py -> build\lib.win-amd64-cpython-39\causalml\inference\nn creating build\lib.win-amd64-cpython-39\causalml\inference\tf copying causalml\inference\tf\dragonnet.py -> build\lib.win-amd64-cpython-39\causalml\inference\tf copying causalml\inference\tf\utils.py -> build\lib.win-amd64-cpython-39\causalml\inference\tf copying causalml\inference\tf\init.py -> build\lib.win-amd64-cpython-39\causalml\inference\tf creating build\lib.win-amd64-cpython-39\causalml\inference\tree copying causalml\inference\tree\plot.py -> build\lib.win-amd64-cpython-39\causalml\inference\tree copying causalml\inference\tree\utils.py -> build\lib.win-amd64-cpython-39\causalml\inference\tree copying causalml\inference\tree\init__.py -> build\lib.win-amd64-cpython-39\causalml\inference\tree creating build\lib.win-amd64-cpython-39\causalml\inference\tree\causal copying causalml\inference\tree\causal\causalforest.py -> build\lib.win-amd64-cpython-39\causalml\inference\tree\causal copying causalml\inference\tree\causal\causaltree.py -> build\lib.win-amd64-cpython-39\causalml\inference\tree\causal copying causalml\inference\tree\causal_tree.py -> build\lib.win-amd64-cpython-39\causalml\inference\tree\causal copying causalml\inference\tree\causal\init__.py -> build\lib.win-amd64-cpython-39\causalml\inference\tree\causal running egg_info writing causalml.egg-info\PKG-INFO writing dependency_links to causalml.egg-info\dependency_links.txt writing requirements to causalml.egg-info\requires.txt writing top-level names to causalml.egg-info\top_level.txt dependency C:\Users\mingy\AppData\Local\Temp\pip-build-env-o9vfy_7l\overlay\Lib\site-packages\numpy\core\include\numpy\arrayobject.h won't be automatically included in the manifest: the path must be relative dependency C:\Users\mingy\AppData\Local\Temp\pip-build-env-o9vfy_7l\overlay\Lib\site-packages\numpy\core\include\numpy\arrayscalars.h won't be automatically included in the manifest: the path must be relative dependency C:\Users\mingy\AppData\Local\Temp\pip-build-env-o9vfy_7l\overlay\Lib\site-packages\numpy\core\include\numpy\ndarrayobject.h won't be automatically included in the manifest: the path must be relative dependency C:\Users\mingy\AppData\Local\Temp\pip-build-env-o9vfy_7l\overlay\Lib\site-packages\numpy\core\include\numpy\ndarraytypes.h won't be automatically included in the manifest: the path must be relative dependency C:\Users\mingy\AppData\Local\Temp\pip-build-env-o9vfy_7l\overlay\Lib\site-packages\numpy\core\include\numpy\ufuncobject.h won't be automatically included in the manifest: the path must be relative dependency C:\Users\mingy\AppData\Local\Temp\pip-build-env-o9vfy_7l\overlay\Lib\site-packages\numpy\core\include\numpy\arrayobject.h won't be automatically included in the manifest: the path must be relative dependency C:\Users\mingy\AppData\Local\Temp\pip-build-env-o9vfy_7l\overlay\Lib\site-packages\numpy\core\include\numpy\arrayscalars.h won't be automatically included in the manifest: the path must be relative dependency C:\Users\mingy\AppData\Local\Temp\pip-build-env-o9vfy_7l\overlay\Lib\site-packages\numpy\core\include\numpy\ndarrayobject.h won't be automatically included in the manifest: the path must be relative dependency C:\Users\mingy\AppData\Local\Temp\pip-build-env-o9vfy_7l\overlay\Lib\site-packages\numpy\core\include\numpy\ndarraytypes.h won't be automatically included in the manifest: the path must be relative dependency C:\Users\mingy\AppData\Local\Temp\pip-build-env-o9vfy_7l\overlay\Lib\site-packages\numpy\core\include\numpy\ufuncobject.h won't be automatically included in the manifest: the path must be relative reading manifest file 'causalml.egg-info\SOURCES.txt' reading manifest template 'MANIFEST.in' warning: no files found matching '.txt' warning: no files found matching '.h' under directory 'causalml' adding license file 'LICENSE' writing manifest file 'causalml.egg-info\SOURCES.txt' C:\Users\mingy\AppData\Local\Temp\pip-build-env-o9vfy_7l\overlay\Lib\site-packages\setuptools\command\build_py.py:204: _Warning: Package 'causalml.inference.tree' is absent from the packages configuration. !!

      ############################
      # Package would be ignored #
      ############################
      Python recognizes 'causalml.inference.tree' as an importable package[^1],
      but it is absent from setuptools' `packages` configuration.

      This leads to an ambiguous overall configuration. If you want to distribute this
      package, please make sure that 'causalml.inference.tree' is explicitly added
      to the `packages` configuration field.

      Alternatively, you can also rely on setuptools' discovery methods
      (for example by using `find_namespace_packages(...)`/`find_namespace:`
      instead of `find_packages(...)`/`find:`).

      You can read more about "package discovery" on setuptools documentation page:

      - https://setuptools.pypa.io/en/latest/userguide/package_discovery.html

      If you don't want 'causalml.inference.tree' to be distributed and are
      already explicitly excluding 'causalml.inference.tree' via
      `find_namespace_packages(...)/find_namespace` or `find_packages(...)/find`,
      you can try to use `exclude_package_data`, or `include-package-data=False` in
      combination with a more fine grained `package-data` configuration.

      You can read more about "package data files" on setuptools documentation page:

      - https://setuptools.pypa.io/en/latest/userguide/datafiles.html

      [^1]: For Python, any directory (with suitable naming) can be imported,
            even if it does not contain any `.py` files.
            On the other hand, currently there is no concept of package data
            directory, all directories are treated like packages.

!! check.warn(importable) C:\Users\mingy\AppData\Local\Temp\pip-build-env-o9vfy_7l\overlay\Lib\site-packages\setuptools\command\build_py.py:204: _Warning: Package 'causalml.inference.tree.causal' is absent from the packages configuration. !! ############################

Package would be ignored

      ############################
      Python recognizes 'causalml.inference.tree.causal' as an importable package[^1],
      but it is absent from setuptools' `packages` configuration.

      This leads to an ambiguous overall configuration. If you want to distribute this
      package, please make sure that 'causalml.inference.tree.causal' is explicitly added
      to the `packages` configuration field.

      Alternatively, you can also rely on setuptools' discovery methods
      (for example by using `find_namespace_packages(...)`/`find_namespace:`
      instead of `find_packages(...)`/`find:`).

      You can read more about "package discovery" on setuptools documentation page:

      - https://setuptools.pypa.io/en/latest/userguide/package_discovery.html

      If you don't want 'causalml.inference.tree.causal' to be distributed and are
      already explicitly excluding 'causalml.inference.tree.causal' via
      `find_namespace_packages(...)/find_namespace` or `find_packages(...)/find`,
      you can try to use `exclude_package_data`, or `include-package-data=False` in
      combination with a more fine grained `package-data` configuration.

      You can read more about "package data files" on setuptools documentation page:

      - https://setuptools.pypa.io/en/latest/userguide/datafiles.html

      [^1]: For Python, any directory (with suitable naming) can be imported,
            even if it does not contain any `.py` files.
            On the other hand, currently there is no concept of package data
            directory, all directories are treated like packages.

!! check.warn(importable) copying causalml\inference\tree\uplift.c -> build\lib.win-amd64-cpython-39\causalml\inference\tree copying causalml\inference\tree\causal_builder.c -> build\lib.win-amd64-cpython-39\causalml\inference\tree\causal copying causalml\inference\tree\causal_criterion.c -> build\lib.win-amd64-cpython-39\causalml\inference\tree\causal copying causalml\inference\tree\uplift.pyx -> build\lib.win-amd64-cpython-39\causalml\inference\tree copying causalml\inference\tree\causal_builder.pxd -> build\lib.win-amd64-cpython-39\causalml\inference\tree\causal copying causalml\inference\tree\causal_builder.pyx -> build\lib.win-amd64-cpython-39\causalml\inference\tree\causal copying causalml\inference\tree\causal_criterion.pxd -> build\lib.win-amd64-cpython-39\causalml\inference\tree\causal copying causalml\inference\tree\causal_criterion.pyx -> build\lib.win-amd64-cpython-39\causalml\inference\tree\causal copying causalml\inference\tree\causal\builder.c -> build\lib.win-amd64-cpython-39\causalml\inference\tree\causal copying causalml\inference\tree\causal\criterion.c -> build\lib.win-amd64-cpython-39\causalml\inference\tree\causal running build_ext building 'causalml.inference.tree.causal._criterion' extension error: Microsoft Visual C++ 14.0 or greater is required. Get it with "Microsoft C++ Build Tools": https://visualstudio.microsoft.com/visual-cpp-build-tools/

ERROR: Failed building wheel for causalml Failed to build causalml ERROR: Could not build wheels for causalml which use PEP 517 and cannot be installed directly

shakednave-vi commented 1 year ago

@jeongyoonlee Experiencing identical problems in my situation. Essentially, my utilization of pip, along with the deeply rooted dependencies on outdated versions of pandas, cytron, and sklearn, renders the situation unmanageable. Is there a viable resolution to this predicament? I find myself compelled to continue utilizing sklearn==1.22. cc @MingyueHe

ras44 commented 1 year ago

hi @MingyueHe @shakednave-vi could you please try to follow the instructions in #678? thanks

shakednave-vi commented 1 year ago

@ras44 could you please explain how it would mitigate the problem I encounter while trying to utilize both sklearn==1.2.2 and causalml in the same virtual env?

ras44 commented 1 year ago

@shakednave-vi you'd mentioned having identical problems as @MingyueHe, which I believe was due to a Microsoft Build tool error:

error: Microsoft Visual C++ 14.0 or greater is required. Get it with "Microsoft C++ Build Tools": https://visualstudio.microsoft.com/visual-cpp-build-tools/

the fix described in #678 relates to installing the Microsoft build tools properly on Windows, which should allow for a successful install on Windows via pip.

If you have having issues related to sklearn dependencies, those should be raised in a separate issue (or appended to already open related issues such as #628 or #619).

Hope that is helpful.

AmyLin0515 commented 1 year ago

Hi @ras44 , I faced the same issue and I followed the instruction in #678 . Still I couldn't install the casualml package. I saw following errors:

C:\Users\I-JuLin\AppData\Local\Temp\pip-build-env-h7inbbhu\overlay\Lib\site-packages\setuptools\command\build_py.py:204: _Warning: Package 'causalml.inference.tree.causal' is absent from the packages configuration. !!

          ********************************************************************************
          ############################
          # Package would be ignored #
          ############################
          Python recognizes 'causalml.inference.tree.causal' as an importable package[^1],
          but it is absent from setuptools' `packages` configuration.

          This leads to an ambiguous overall configuration. If you want to distribute this
          package, please make sure that 'causalml.inference.tree.causal' is explicitly added
          to the `packages` configuration field.

          Alternatively, you can also rely on setuptools' discovery methods
          (for example by using `find_namespace_packages(...)`/`find_namespace:`
          instead of `find_packages(...)`/`find:`).

          You can read more about "package discovery" on setuptools documentation page:

          - https://setuptools.pypa.io/en/latest/userguide/package_discovery.html

          If you don't want 'causalml.inference.tree.causal' to be distributed and are
          already explicitly excluding 'causalml.inference.tree.causal' via
          `find_namespace_packages(...)/find_namespace` or `find_packages(...)/find`,
          you can try to use `exclude_package_data`, or `include-package-data=False` in
          combination with a more fine grained `package-data` configuration.

          You can read more about "package data files" on setuptools documentation page:

          - https://setuptools.pypa.io/en/latest/userguide/datafiles.html

          [^1]: For Python, any directory (with suitable naming) can be imported,
                even if it does not contain any `.py` files.
                On the other hand, currently there is no concept of package data
                directory, all directories are treated like packages.
          ********************************************************************************

  !!
    check.warn(importable)
  error: command 'cl.exe' failed: None
  [end of output]

note: This error originates from a subprocess, and is likely not a problem with pip. ERROR: Failed building wheel for causalml Failed to build causalml ERROR: Could not build wheels for causalml, which is required to install pyproject.toml-based projects

ras44 commented 1 year ago

Hi @AmyLin0515,

The error messsage seems to indicate that the cl command failed, which means the C/C++ compiler isn't installed correctly.

as a test, can you follow the steps in:

image

In other words, you should be able to run cl in a developer command prompt without errors. If there is an error of that command doesn't exist, follow the instructions again for installing the c/c++ development workload:

image

Even more troubleshooting/examples can be found at: https://learn.microsoft.com/en-us/cpp/build/walkthrough-compiling-a-native-cpp-program-on-the-command-line?view=msvc-170&redirectedfrom=MSDN

Finally, also try opening a new shell to load any update paths to cl (don't use a shell that was open prior to installing the development workload as that won't have updated paths).

Hope that helps!

AmyLin0515 commented 1 year ago

Hi @ras44 , thanks for additional instructions, but I do have c/c++ development installed. And there is no error when I run cl command in developer command prompt. image image

After running this command, I opened anaconda prompt again to activate causalml-py38. Then run this command

git clone https://github.com/uber/causalml.git cd causalml pip install . python setup.py build_ext --inplace

However, the same error pops up.

error: subprocess-exited-with-error

× Building wheel for causalml (pyproject.toml) did not run successfully. │ exit code: 1 ╰─> [112 lines of output] running bdist_wheel running build running build_py running egg_info writing causalml.egg-info\PKG-INFO writing dependency_links to causalml.egg-info\dependency_links.txt writing requirements to causalml.egg-info\requires.txt writing top-level names to causalml.egg-info\top_level.txt dependency C:\Users\I-JuLin\AppData\Local\Temp\pip-build-env-p67o7d_q\overlay\Lib\site-packages\numpy\core\include\numpy\arrayobject.h won't be automatically included in the manifest: the path must be relative dependency C:\Users\I-JuLin\AppData\Local\Temp\pip-build-env-p67o7d_q\overlay\Lib\site-packages\numpy\core\include\numpy\arrayscalars.h won't be automatically included in the manifest: the path must be relative dependency C:\Users\I-JuLin\AppData\Local\Temp\pip-build-env-p67o7d_q\overlay\Lib\site-packages\numpy\core\include\numpy\ndarrayobject.h won't be automatically included in the manifest: the path must be relative dependency C:\Users\I-JuLin\AppData\Local\Temp\pip-build-env-p67o7d_q\overlay\Lib\site-packages\numpy\core\include\numpy\ndarraytypes.h won't be automatically included in the manifest: the path must be relative dependency C:\Users\I-JuLin\AppData\Local\Temp\pip-build-env-p67o7d_q\overlay\Lib\site-packages\numpy\core\include\numpy\ufuncobject.h won't be automatically included in the manifest: the path must be relative dependency C:\Users\I-JuLin\AppData\Local\Temp\pip-build-env-p67o7d_q\overlay\Lib\site-packages\numpy\core\include\numpy\arrayobject.h won't be automatically included in the manifest: the path must be relative dependency C:\Users\I-JuLin\AppData\Local\Temp\pip-build-env-p67o7d_q\overlay\Lib\site-packages\numpy\core\include\numpy\arrayscalars.h won't be automatically included in the manifest: the path must be relative dependency C:\Users\I-JuLin\AppData\Local\Temp\pip-build-env-p67o7d_q\overlay\Lib\site-packages\numpy\core\include\numpy\ndarrayobject.h won't be automatically included in the manifest: the path must be relative dependency C:\Users\I-JuLin\AppData\Local\Temp\pip-build-env-p67o7d_q\overlay\Lib\site-packages\numpy\core\include\numpy\ndarraytypes.h won't be automatically included in the manifest: the path must be relative dependency C:\Users\I-JuLin\AppData\Local\Temp\pip-build-env-p67o7d_q\overlay\Lib\site-packages\numpy\core\include\numpy\ufuncobject.h won't be automatically included in the manifest: the path must be relative reading manifest file 'causalml.egg-info\SOURCES.txt' reading manifest template 'MANIFEST.in' warning: no files found matching '.txt' warning: no files found matching '.h' under directory 'causalml' adding license file 'LICENSE' writing manifest file 'causalml.egg-info\SOURCES.txt' copying causalml\inference\tree\causal_builder.c -> build\lib.win-amd64-cpython-38\causalml\inference\tree\causal copying causalml\inference\tree\causal_criterion.c -> build\lib.win-amd64-cpython-38\causalml\inference\tree\causal running build_ext building 'causalml.inference.tree.causal._criterion' extension cl.exe /c /nologo /O2 /W3 /GL /DNDEBUG /MD -IC:\Users\I-JuLin\AppData\Local\Temp\pip-build-env-p67o7d_q\overlay\Lib\site-packages\numpy\core\include -IC:\Users\I-JuLin\AppData\Local\Temp\pip-build-env-p67o7d_q\overlay\Lib\site-packages\numpy\core\include -IC:\Users\I-JuLin\anaconda3\envs\causalml-py38\include -IC:\Users\I-JuLin\anaconda3\envs\causalml-py38\Include /Tccausalml/inference/tree/causal/_criterion.c /Fobuild\temp.win-amd64-cpython-38\Release\causalml/inference/tree/causal/_criterion.obj -O3 C:\Users\I-JuLin\AppData\Local\Temp\pip-build-env-p67o7d_q\overlay\Lib\site-packages\setuptools\command\build_py.py:204: _Warning: Package 'causalml.inference.tree' is absent from the packages configuration. !!

          ********************************************************************************
          ############################
          # Package would be ignored #
          ############################
          Python recognizes 'causalml.inference.tree' as an importable package[^1],
          but it is absent from setuptools' `packages` configuration.

          This leads to an ambiguous overall configuration. If you want to distribute this
          package, please make sure that 'causalml.inference.tree' is explicitly added
          to the `packages` configuration field.

          Alternatively, you can also rely on setuptools' discovery methods
          (for example by using `find_namespace_packages(...)`/`find_namespace:`
          instead of `find_packages(...)`/`find:`).

          You can read more about "package discovery" on setuptools documentation page:

          - https://setuptools.pypa.io/en/latest/userguide/package_discovery.html

          If you don't want 'causalml.inference.tree' to be distributed and are
          already explicitly excluding 'causalml.inference.tree' via
          `find_namespace_packages(...)/find_namespace` or `find_packages(...)/find`,
          you can try to use `exclude_package_data`, or `include-package-data=False` in
          combination with a more fine grained `package-data` configuration.

          You can read more about "package data files" on setuptools documentation page:

          - https://setuptools.pypa.io/en/latest/userguide/datafiles.html

          [^1]: For Python, any directory (with suitable naming) can be imported,
                even if it does not contain any `.py` files.
                On the other hand, currently there is no concept of package data
                directory, all directories are treated like packages.
          ********************************************************************************

  !!
    check.warn(importable)
  C:\Users\I-JuLin\AppData\Local\Temp\pip-build-env-p67o7d_q\overlay\Lib\site-packages\setuptools\command\build_py.py:204: _Warning: Package 'causalml.inference.tree.causal' is absent from the `packages` configuration.
  !!

          ********************************************************************************
          ############################
          # Package would be ignored #
          ############################
          Python recognizes 'causalml.inference.tree.causal' as an importable package[^1],
          but it is absent from setuptools' `packages` configuration.

          This leads to an ambiguous overall configuration. If you want to distribute this
          package, please make sure that 'causalml.inference.tree.causal' is explicitly added
          to the `packages` configuration field.

          Alternatively, you can also rely on setuptools' discovery methods
          (for example by using `find_namespace_packages(...)`/`find_namespace:`
          instead of `find_packages(...)`/`find:`).

          You can read more about "package discovery" on setuptools documentation page:

          - https://setuptools.pypa.io/en/latest/userguide/package_discovery.html

          If you don't want 'causalml.inference.tree.causal' to be distributed and are
          already explicitly excluding 'causalml.inference.tree.causal' via
          `find_namespace_packages(...)/find_namespace` or `find_packages(...)/find`,
          you can try to use `exclude_package_data`, or `include-package-data=False` in
          combination with a more fine grained `package-data` configuration.

          You can read more about "package data files" on setuptools documentation page:

          - https://setuptools.pypa.io/en/latest/userguide/datafiles.html

          [^1]: For Python, any directory (with suitable naming) can be imported,
                even if it does not contain any `.py` files.
                On the other hand, currently there is no concept of package data
                directory, all directories are treated like packages.
          ********************************************************************************

  !!
    check.warn(importable)
  error: command 'cl.exe' failed: None
  [end of output]

note: This error originates from a subprocess, and is likely not a problem with pip. ERROR: Failed building wheel for causalml Failed to build causalml ERROR: Could not build wheels for causalml, which is required to install pyproject.toml-based projects

ras44 commented 1 year ago

Thanks for helping to troubleshoot this, @AmyLin0515

Just to confirm: are you running the following commands individually in new Anaconda Powershell Prompt and not the normal Anaconda Prompt nor any of the shell prompts available within jupyter notebooks?

Create a clean conda env:

conda create -n causalml-py38 python=3.8
conda activate causalml-py38
conda install -c conda-forge cxx-compiler
conda install python-graphviz
conda install -c conda-forge xorg-libxrender

Build causalml:

git clone https://github.com/uber/causalml.git
cd causalml
pip install .
python setup.py build_ext --inplace

Thanks

ras44 commented 1 year ago

Another troubleshooting possibility is the steps described in https://github.com/uber/causalml/issues/665#issuecomment-1711185708 which relate to the VS Build tools version and the Python with Miniconda.

AmyLin0515 commented 1 year ago

Hi @ras44 , I really appreciate you. I use Anaconda Powershell Prompt instead. It looks like it was installed successfully. But when I use this causalml-py38 environment in Visual Studio. Why I still don't see causalml installed?

image image

AmyLin0515 commented 1 year ago

Never mind! I found it was linked to miniconda, so I changed it to anaconda envs. I got the package installed! Thanks again.

ras44 commented 1 year ago

FYI, in my experience, there is an issue when attempting to use conda in anything other than Anaconda Powershell Prompt. In other shells, or even from within jupyter notebook, it seems like you can activate the conda env (and when you run conda env list it will show an asterisk by the activated environment, but the environment is not really activated- so changes aren't made to the environment you think you're in, but rather the base environment.

I feel like the crux of the remaining issues are related to the PATH variable in Windows and how Anaconda/miniconda and dev libraries are found through PATH.