在本地安装GraphScope

本指南将引导您完成在本地机器上安装GraphScope的过程。

前提条件

  • Ubuntu 20.04 或更高版本,CentOS 7 或更高版本,或 macOS 12(Intel/Apple silicon)或更高版本

  • Python 3.7 ~ 3.11版本,且pip版本≥19.3

  • JDK 11(如需使用GIE,JDK 8和20均存在已知兼容性问题)

从软件包安装

GraphScope通过Python wheels进行分发,可直接通过pip安装。

安装GraphScope稳定版本

您可以使用pip安装最新的稳定版graphscope包

python3 -m pip install graphscope --upgrade

提示

如果下载速度非常慢,可以尝试使用pip的镜像站点。

python3 -m pip install graphscope --upgrade \
    -i http://mirrors.aliyun.com/pypi/simple/ --trusted-host=mirrors.aliyun.com

如果遇到类似Could not find a version that satisfies the requirement graphscope (from versions: )的错误, 请检查您是否在使用旧版pip,并确保pip版本≥19.3,因为graphscope的wheel文件兼容the manylinux2014 ABI

python3 -m pip install --upgrade pip

上述命令将下载在本地机器上以独立模式运行GraphScope所需的所有组件。

安装GraphScope预览版

如果您希望体验最新功能,可以安装预览版本,该版本以每日构建的方式发布。

python3 -m pip install graphscope --pre

为了获得一个干净整洁的环境,您也可以使用Docker环境快速入门。

docker run --name dev -it --shm-size=4096m ubuntu:latest

# inside the docker
apt-get update -y && apt-get install python3-pip default-jdk -y
python3 -m pip install graphscope ipython tensorflow

从源码安装

可选地,您可以从源代码构建GraphScope并将其安装到您的机器上。

为Linux和macOS设置构建环境

从源码构建GraphScope需要许多库和工具作为依赖项。我们提供了一个实用脚本gs来帮助您安装所有依赖项。

# Download source code
git clone https://github.com/alibaba/graphscope
cd graphscope

python3 gsctl.py install-deps dev
# use --help to get more usage.

使用已安装所有依赖项的开发镜像

为了简化操作,我们提供了一个预构建的Docker镜像,其中已安装所有依赖项。 您可以直接拉取该镜像并在容器中使用它来构建GraphScope。

docker pull registry.cn-hongkong.aliyuncs.com/graphscope/graphscope-dev:latest
docker run --name dev -it --shm-size=4096m registry.cn-hongkong.aliyuncs.com/graphscope/graphscope-dev:latest

# In the container, download the source code.
git clone https://github.com/alibaba/graphscope

构建与安装

在本地或容器中安装完依赖项后,您可以在源代码的根目录下构建并安装GraphScope。

make
make install

注意

分析引擎(GAE)可能需要进行即时编译,这需要clang或g++。因此可能需要额外的设置步骤来安装build-essentials。例如,在Ubuntu系统上:

apt update -y &&
apt install cmake build-essential -y

注意

学习引擎(GLE)目前不支持在Python 3.11上运行,因为TensorFlow尚未支持该版本。

注意

目前对基于arm架构平台的支持仍处于非常初步的阶段,尚未准备好投入生产环境使用。