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

pip install fails on pyton 3.11, command 'cl.exe' failed: None, cannot build wheels for causalml #665

Closed
priya-velu5 opened this issue Aug 24, 2023 · 5 comments
Labels
installation Issues related to installation

Comments

@priya-velu5
Copy link

priya-velu5 commented Aug 24, 2023

*pip install fails. Please update the documentation with requirements.txt file location as casualml/docs

To Reproduce
$ git clone https://github.com/uber/causalml.git
$ cd causalml
$ pip install -r requirements.txt
$ pip install causalml

Expected behavior
causalml installed

Snippet of the output
image

Environment:

  • OS: Windows 64 bit
  • Python Version: 3.11.1
@priya-velu5 priya-velu5 added the bug Something isn't working label Aug 24, 2023
@priya-velu5 priya-velu5 changed the title Requirements.txt file missing pip install fails on pyton 3.11 Aug 24, 2023
@jeongyoonlee jeongyoonlee added installation Issues related to installation and removed bug Something isn't working labels Aug 24, 2023
@jeongyoonlee
Copy link
Collaborator

jeongyoonlee commented Aug 24, 2023

requirements.txt is deprecated, and pyproject.toml replaced it in #553.

Can you try to install the latest version from the repo by following the instructions in README.md?

# Create a clean conda environment and install conda dependencies:
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

# Install CausalML from source:
git clone https://github.com/uber/causalml.git
cd causalml
pip install .
python setup.py build_ext --inplace

@priya-velu5
Copy link
Author

followed all the steps till pip install .

The error I got -
image

@jeongyoonlee
Copy link
Collaborator

It seems that you don't have cl.exe, the Microsoft C compiler, installed on your system (ref [1]). You can either install it before using pip install, or use conda-forge install:

conda install -c conda-forge causalml

@priya-velu5
Copy link
Author

priya-velu5 commented Sep 8, 2023

The installation succeeded after uninstalling and re-installing my:

  1. Python with Miniconda (I use miniconda since I just want the conda command prompt), and
  2. Visual Studio Build tools 2019 and 2022. (VS 2022 build tools are probably not needed).

Important note:

  • The installation needed to be done through the Developer Command Prompt for VS 2019. Using developer command prompt ensures that pip can find cl.exe file (source). We cannot manually set the PATH environment variable.
  • The commands
    conda install -c conda-forge cxx-compiler
    conda install python-graphviz
    conda install -c conda-forge xorg-libxrender

needed visual studio 2019 build tools to be successful. I ran into "The system cannot find the path specified." errors when I tried installing with the 2022 developer command prompt. It was looking for files specifically inside the "2019" folder.

See this file to view the errors I ran into while installing through Developer Command Prompt for VS 2022

Installing Build Tools for Visual Studio 2019:

  • Select "Desktop Development with C++"

Installing miniconda:

  • Set conda to path since you'll need to access conda through the VS developer command prompt and not just Anaconda prompt.

@priya-velu5 priya-velu5 reopened this Sep 8, 2023
@priya-velu5 priya-velu5 changed the title pip install fails on pyton 3.11 pip install fails on pyton 3.11, command 'cl.exe' failed: None, cannot build wheels for causalml Sep 8, 2023
@jeongyoonlee
Copy link
Collaborator

Thanks, @priya-velu5, for sharing this. This will help other Windows users greatly.

@ras44, can you try this and update #678 accordingly? Thanks.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
installation Issues related to installation
Projects
None yet
Development

No branches or pull requests

2 participants