在 linux 上安装#

本指南包含以下主题:

  1. 安装依赖关系

  2. 下载代码库

  3. 设置编译环境

安装依赖关系#

下面列出了几种流行Linux发行版的安装命令。

对应的系统,使用对应的命令:

Debian/Ubuntu:

sudo apt-get install python3 python3-pip git git-lfs
git lfs install --skip-repo

Redhat/Fedora:

sudo yum install python python-pip git git-lfs
git lfs install --skip-repo

Arch Linux:

sudo pacman -S python python-pip git git-lfs
git lfs install --skip-repo

下载代码库#

使用下面的命令检出Blender手册代码库:

cd ~
git clone https://projects.blender.org/blender/blender-manual.git

代码库下载需要几分钟时间,这取决于你的网络连接。

设置编译环境#

Tip

It is recommended to setup and activate a virtual Python environment where dependencies will be installed:

python3 -m venv .venv
source .venv/bin/activate

Repeat the source .venv/bin/activate command to re-activate the virtual environment, whenever you open a new terminal to build the documentation.

This step may be required on some distributions that enforce PEP 668.

  • 打开终端窗口。

  • 进入刚被 git clone 添加的 blender-manual 文件夹:

    cd ~/blender-manual
    
  • 文件夹中有一个名为 requirements.txt 的文件,包含了一系列需要安装的依赖关系。要安装这些依赖关系,可以使用 pip3 命令:

    pip3 install -r requirements.txt
    

Note

时不时使用下面的命令确认你的依赖库是不是最新的:

pip3 install -r requirements.txt --upgrade