没腿的鸟 发表于 2025-4-4 21:06:59

【错误记录】安装 向量数据库 chromadb 报错 ( Cargo, the Rust package manager, is not installed o

一、错误记录


执行 pip install chromadb
下令 , 安装 向量数据库 chromadb , 执行后报错 ;
https://i-blog.csdnimg.cn/direct/9008ca9cae5a4397b10df28041f9c227.png
焦点报错信息 :
    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....
完备报错信息 :
C:\Users\octop>pip install chromadb
Collecting chromadbDownloading chromadb-0.4.14-py3-none-any.whl (448 kB)   |████████████████████████████████| 448 kB 93 kB/sCollecting pypika>=0.48.9Downloading PyPika-0.48.9.tar.gz (67 kB)   |████████████████████████████████| 67 kB 60 kB/sInstalling build dependencies ... doneGetting requirements to build wheel ... done    Preparing wheel metadata ... doneCollecting overrides>=7.3.1Downloading overrides-7.7.0-py3-none-any.whl (17 kB)Requirement already satisfied: grpcio>=1.58.0 in d:\001_develop\022_python\python37_64\lib\site-packages (from chromadb) (1.62.3)Collecting graphlib-backport>=1.0.3; python_version < "3.9"Downloading graphlib_backport-1.1.0-py3-none-any.whl (7.1 kB)Requirement already satisfied: numpy==1.21.6; python_version < "3.8" in d:\001_develop\022_python\python37_64\lib\site-packages (from chromadb) (1.21.6)Requirement already satisfied: typer>=0.9.0 in d:\001_develop\022_python\python37_64\lib\site-packages (from chromadb) (0.15.1)Collecting fastapi>=0.95.2Downloading fastapi-0.103.2-py3-none-any.whl (66 kB)   |████████████████████████████████| 66 kB 138 kB/sRequirement already satisfied: tqdm>=4.65.0 in d:\001_develop\022_python\python37_64\lib\site-packages (from chromadb) (4.66.4)Requirement already satisfied: importlib-resources in d:\001_develop\022_python\python37_64\lib\site-packages (from chromadb) (5.12.0)Requirement already satisfied: typing-extensions>=4.5.0 in d:\001_develop\022_python\python37_64\lib\site-packages (from chromadb) (4.7.1)Collecting posthog>=2.4.0Downloading posthog-3.18.0-py2.py3-none-any.whl (76 kB)   |████████████████████████████████| 76 kB 217 kB/sCollecting pulsar-client>=3.1.0Downloading pulsar_client-3.3.0-cp37-cp37m-win_amd64.whl (3.4 MB)   |████████████████████████████████| 3.4 MB 819 kB/sCollecting uvicorn>=0.18.3Downloading uvicorn-0.22.0-py3-none-any.whl (58 kB)   |████████████████████████████████| 58 kB 727 kB/sCollecting bcrypt>=4.0.1Downloading bcrypt-4.2.1-cp37-abi3-win_amd64.whl (152 kB)   |████████████████████████████████| 152 kB 656 kB/sCollecting chroma-hnswlib==0.7.3Downloading chroma_hnswlib-0.7.3-cp37-cp37m-win_amd64.whl (152 kB)   |████████████████████████████████| 152 kB 726 kB/sRequirement already satisfied: pydantic>=1.9 in d:\001_develop\022_python\python37_64\lib\site-packages (from chromadb) (2.5.3)Requirement already satisfied: requests>=2.28 in d:\001_develop\022_python\python37_64\lib\site-packages (from chromadb) (2.31.0)Collecting tokenizers>=0.13.2Downloading tokenizers-0.21.0.tar.gz (343 kB)   |████████████████████████████████| 343 kB 819 kB/sInstalling build dependencies ... doneGetting requirements to build wheel ... done    Preparing wheel metadata ... error    ERROR: Command errored out with exit status 1:   command: 'd:\001_develop\022_python\python37_64\python.exe' 'd:\001_develop\022_python\python37_64\lib\site-packages\pip\_vendor\pep517\_in_process.py' prepare_metadata_for_build_wheel 'C:\Users\octop\AppData\Local\Temp\tmpdpqiqp98'         cwd: C:\Users\octop\AppData\Local\Temp\pip-install-0tgg_fb8\tokenizers    Complete output (6 lines):    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....
    ----------------------------------------ERROR: Command errored out with exit status 1: 'd:\001_develop\022_python\python37_64\python.exe' 'd:\001_develop\022_python\python37_64\lib\site-packages\pip\_vendor\pep517\_in_process.py' prepare_metadata_for_build_wheel 'C:\Users\octop\AppData\Local\Temp\tmpdpqiqp98' Check the logs for full command output.WARNING: You are using pip version 20.1.1; however, version 24.0 is available.You should consider upgrading via the 'd:\001_develop\022_python\python37_64\python.exe -m pip install --upgrade pip' command.C:\Users\octop> 报错截图 :
https://i-blog.csdnimg.cn/direct/355757cf03fb48e790a6a2e9f829a2d1.png




二、办理方案


解读报错信息 :
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/
Rust 包管理器 Cargo 未安装或未添加到 PATH 中。此包需要 Rust 和 Cargo 来编译扩展。请通过系统的包管理器或访问 https://rustup.rs/ 举行安装。

安装 chromadb 向量数据库 时因缺少 Rust 和 Cargo 导致错误 , 需先安装 Rust 工具链(包含 Cargo), 然后重新执行 " pip install chromadb
" 安装下令 ;
到 https://rustup.rs/ 网站 , 下载 rust 安装包 rustup-init.exe ; 点击下图中的链接 , 即可下载 ;
下载地址为 https://win.rustup.rs/x86_64 ;
https://i-blog.csdnimg.cn/direct/2619e524e1884308b4a5e6df6cb67f99.png
运行 上述 rustup-init.exe 步伐 , 弹出如下对话框 :
https://i-blog.csdnimg.cn/direct/bdc24d182c6e47ff9b52eccb16d7cd9d.png
上述对话框的内容如下 :
Welcome to Rust!

This will download and install the official compiler for the Rust
programming language, and its package manager, Cargo.

Rustup metadata and toolchains will be installed into the Rustup
home directory, located at:

C:\Users\octop\.rustup

This can be modified with the RUSTUP_HOME environment variable.

The Cargo home directory is located at:

C:\Users\octop\.cargo

This can be modified with the CARGO_HOME environment variable.

The cargo, rustc, rustup and other commands will be added to
Cargo's bin directory, located at:

C:\Users\octop\.cargo\bin

This path will then be added to your PATH environment variable by
modifying the HKEY_CURRENT_USER/Environment/PATH registry key.

You can uninstall at any time with rustup self uninstall and
these changes will be reverted.

Current installation options:


   default host triple: x86_64-pc-windows-msvc
   default toolchain: stable (default)
               profile: default
modify PATH variable: yes

1) Proceed with standard installation (default - just press enter)
2) Customize installation
3) Cancel installation
>

在上述下令行中 , 给出了 C:\Users\octop.cargo\bin 的路径 , 这是 Cargo 可执行步伐的目次 , 必须将该目次设置到 Path 环境中 , 才能办理 Cargo, the Rust package manager, is not installed or is not on PATH. 报错 ;

下一步选择 , 直接点击回车 , 默认安装即可 ;
安装过程中 , 会下载相关依赖 , 等待下载安装完成 ;
https://i-blog.csdnimg.cn/direct/7afd786fdf4e498db7b1972fcb8fdb4c.png
安装完成后 , 执行如下两个下令 , 查看是否安装完成 ;
rustc --version
cargo --version
之后 , 下令行输入 这两个版本号 ;
C:\Users\octop>rustc --version
rustc 1.85.0 (4d91de4e4 2025-02-17)

C:\Users\octop>cargo --version
cargo 1.85.0 (d73d2caf9 2024-12-31)

C:\Users\octop>
https://i-blog.csdnimg.cn/direct/bd254a19b1cf44c49a727c3db0cd1c28.png
继续执行
pip install chromadb
下令 , 即可安装 向量数据库 chromadb 乐成 ;

免责声明:如果侵犯了您的权益,请联系站长,我们会及时删除侵权内容,谢谢合作!更多信息从访问主页:qidao123.com:ToB企服之家,中国第一个企服评测及商务社交产业平台。
页: [1]
查看完整版本: 【错误记录】安装 向量数据库 chromadb 报错 ( Cargo, the Rust package manager, is not installed o