SAGE 安装指南¶
本文档将指导您如何 安装 SAGE 及其相关依赖。请根据您的需求选择合适的安装方式。
A. 前置要求 (Prerequisites)¶
在开始安装之前,请确保您的开发环境满足以下要求:
- 操作系统 (OS):Ubuntu 22.04及以上版本
- 基础依赖:Anaconda/Miniconda
- 备注:建议使用版本 ≥ 3.11.10 的 Python 解释器。
利用 Conda 在虚拟环境中创建并激活环境:
温馨提示:若 Conda 创建失败,可能是网络问题导致,请及时更换 Conda 源。
B. 下载安装 (Installation)¶
SAGE 提供简单的安装方式,您只需通过 pip install isage
命令,即可完成安装,无需下载源码,适合快速部署和使用。
执行以下命令完成安装:
C. 验证安装 (Verify Installation)¶
安装完成后,您可以通过以下任一方式来验证 SAGE 是否已成功安装。
方法1:查看包信息¶
运行 pip show
以检查 SAGE 的安装情况。
您将会看到以下的类似输出:
Name: isage
Version: 0.1.3.1
Summary: SAGE (Meta Package)
Home-page: https://github.com/intellistream/SAGE
Author:
Author-email: SAGE Team <shuhao_zhang@hust.edu.cn>
License: MIT
Location: /path/to/your/python/site-packages
Requires: isage-common, isage-kernel, isage-libs, isage-middleware
Required-by:
方法2:运行 SAGE HelloWorld 程序¶
执行 hello_world.py
Python 文件。
hello_world.py代码如下:
您将会看到一系列的终端输出,表明您顺利完成 SAGE 的安装。
Waiting for batch processing to complete...
HELLO, WORLD! #1
HELLO, WORLD! #2
HELLO, WORLD! #3
HELLO, WORLD! #4
HELLO, WORLD! #5
HELLO, WORLD! #6
HELLO, WORLD! #7
HELLO, WORLD! #8
HELLO, WORLD! #9
HELLO, WORLD! #10
Hello World 批处理示例结束
至此,您已成功安装 SAGE,祝您使用愉快!
D.pip install时可能遇到的问题以及解决方案¶
Python版本过高,报错如下:
Building wheels for collected packages: faiss-cpu, sgmllib3k
Building wheel for faiss-cpu (pyproject.toml) ... error
error: subprocess-exited-with-error
× Building wheel for faiss-cpu (pyproject.toml) did not run successfully.
│ exit code: 1
╰─> [138 lines of output]
/tmp/pip-build-env-08i_jo3h/overlay/lib/python3.13/site-packages/setuptools/config/_apply_pyprojecttoml.py:82: SetuptoolsDeprecationWarning: `project.license` as a TOML table is deprecated
…
note: This error originates from a subprocess, and is likely not a problem with pip.
ERROR: Failed building wheel for faiss-cpu