赞
踩
langflow的github官网
视频推荐Langflow无代码开发AI应用教程在此。
先用conda创建一个名为langflow的环境
conda create -n langflow python==3.12
conda activate langflow
安装稳定版本
python -m pip install langflow -U
(如果你出错的话先试一试出错3的解决办法!!!)
然后报错了
Installing build dependencies ... done Getting requirements to build wheel ... done Preparing metadata (pyproject.toml) ... error error: subprocess-exited-with-error × Preparing metadata (pyproject.toml) did not run successfully. │ exit code: 1 ╰─> [6 lines of output] Cargo, the Rust package manager, is not installed or is not on PATH. This package requires Rust and Cargo to compile extensions. Install it through the system's package manager or via https://rustup.rs/ Checking for Rust toolchain.... [end of output] note: This error originates from a subprocess, and is likely not a problem with pip. error: metadata-generation-failed × Encountered error while generating package metadata. ╰─> See above for output. note: This is an issue with the package mentioned above, not pip. hint: See above for details.
这个错误信息表明在尝试安装一个Python包时遇到了问题,具体来说是在准备pyproject.toml
文件的元数据时失败了。错误的原因是因为当前要安装的Python包需要Rust语言的编译器和Cargo包管理器来编译其扩展。错误信息中提到Cargo没有安装或者没有被添加到系统的PATH环境变量中。
具体的错误信息如下:
Preparing metadata (pyproject.toml) ... error
:在准备pyproject.toml
文件的元数据时发生了错误。
Cargo, the Rust package manager, is not installed or is not on PATH.
:这个包需要Rust和Cargo来编译扩展,但是Cargo没有被安装或者没有被添加到PATH。
This package requires Rust and Cargo to compile extensions.
:这个包需要Rust和Cargo来编译其扩展。
Install it through the system's package manager or via https://rustup.rs/
:建议通过系统的包管理器安装Cargo,或者通过提供的链接https://rustup.rs/来安装。
error: subprocess-exited-with-error
:子进程退出时返回了错误。
error: metadata-generation-failed
:元数据生成失败。
note: This error originates from a subprocess, and is likely not a problem with pip.
:这个错误来自子进程,很可能不是pip的问题。
note: This is an issue with the package mentioned above, not pip.
:这是上面提到的包的问题,不是pip的问题。
hint: See above for details.
:提示查看上面的详细信息。
根据这个错误信息,安装没有成功。你需要做的是安装Rust和Cargo【Rust 和 Cargo 安装指南】,然后再次尝试安装这个Python包。你可以访问https://rustup.rs/来获取安装Rust和Cargo的指导。安装完成后,确保它们被添加到系统的PATH环境变量中,这样pip在安装Python包时可以找到它们。
然后依然会报错
error: `cargo rustc --lib --message-format=json-render-diagnostics --manifest-path Cargo.toml --release -v --features pyo3/extension-module --crate-type cdylib --` failed with code 101
[end of output]
note: This error originates from a subprocess, and is likely not a problem with pip.
ERROR: Failed building wheel for tokenizers
Failed to build pyarrow tokenizers
ERROR: Could not build wheels for pyarrow, tokenizers, which is required to install pyproject.toml-based projects
编译依赖:pyarrow 和 tokenizers 可能依赖于一些需要编译的本地扩展。如果系统中缺少必要的编译器或构建工具,比如 C++ 编译器,那么构建 wheel 就会失败。
确保编译器安装:确保你的系统上安装了 C++ 编译器(如 GCC 或 MSVC),因为很多 Python 包需要它来编译 C 扩展。
所以我们安装Visual Studio Build Tools for C++ 【How to install Visual C++ Build tools?】
注意如果你的系统是win10,把win11去掉,选win10
安装上述步骤后还是不对,最后换了python的版本,原来是3.12换成了3.11就成功了……(这样子一来,我也不确定前面的步骤是不是必要的)
python -m langflow run
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。