我正在尝试使用 Python 3.12 和命令
pip install causalml
在我的 Windows 计算机上安装 causalml。
但是当尝试为 causalml 构建轮子时安装失败。这是错误的片段:
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: ERROR: Failed to build installable wheels for some pyproject.toml based projects (causalml)
我已将错误附加到pastebin上: https://pastebin.com/dehRfgrk
但关键的错误消息是:
use_tracing': is not a member of '_PyCFrame' in causalml/inference/tree/_tree/_tree.cpp.
The command "cl.exe" fails with exit code 2.
Warning regarding deprecated NumPy API and usage of Python 2.7 options (bdist_wheel.universal is deprecated).
Setuptools warnings about missing packages in the packages configuration (causalml.inference.tree, etc.)
我正在使用:
Python 版本:3.12.
操作系统:Windows 10。
编译器:Microsoft Visual Studio 2022 构建工具。
环境:Anaconda 3.
NumPy 版本:1.26.4.
我尝试更新 Visual Studio 构建工具并安装最新版本并确保包含 C++ 构建工具。
查看 PyPi 上的 causalml,Python 3.12 没有可用的轮子。
但是,Python 3.8 - 3.11 有轮子。您可能必须将 Python 降级到受支持的版本(例如 3.11),然后重试。