跳转至内容

从源码安装

此方法推荐给需要修改 Hummingbot 源代码的开发人员和用户。大多数用户应优先选择 Docker 安装

安装依赖项

🛠️ macOS 设置说明

✅ 安装 Xcode 命令行工具

这些工具对于编译某些 Python 依赖项是必需的。

xcode-select --install

注意

在非 Linux 系统上,我们建议使用完整的 Anaconda 发行版,而不是像 Miniconda 这样的轻量级替代方案。Anaconda 包含更广泛的预安装包,有助于防止使用 Miniconda 时常见的依赖项冲突和安装错误。

您可以使用图形界面或命令行安装 Anaconda。

🔹 选项 1:图形安装程序(初学者友好)

  1. 访问 anaconda.com/download
  2. 选择您的版本(Intel 或 Apple Silicon)
  3. 点击 Download for Mac
  4. 按照安装程序提示操作

🔹 选项 2:命令行安装程序

如果您对终端熟悉,可使用此方法。

对于搭载 Intel (x86) 的 macOS:

curl -O https://repo.anaconda.com/archive/Anaconda3-2024.10-1-MacOSX-x86_64.sh
bash Anaconda3-2024.10-1-MacOSX-x86_64.sh

对于搭载 Apple Silicon (M1/M2/M3) 的 macOS:

curl -O https://repo.anaconda.com/archive/Anaconda3-2024.10-1-MacOSX-arm64.sh
bash Anaconda3-2024.10-1-MacOSX-arm64.sh

🐧 Linux 设置说明

✅ 安装/更新系统包

sudo apt update && sudo apt upgrade -y && sudo apt install -y build-essential

✅ 安装 Miniconda

wget https://repo.anaconda.com/miniconda/Miniconda3-latest-Linux-x86_64.sh
bash Miniconda3-latest-Linux-x86_64.sh

🪟 Windows 设置说明

✅ 安装 WSL2 和 Ubuntu

这可能需要一段时间才能完成,且可能需要重新启动系统。

wsl --install -d Ubuntu

Ubuntu 发行版安装完成后,打开 Ubuntu 终端并按照 Linux 部分的说明安装依赖项。

注意

请在 Ubuntu 终端中运行下面的所有安装命令,不是 Windows 命令提示符或 PowerShell。

安装步骤

克隆仓库

git clone https://github.com/hummingbot/hummingbot.git
cd hummingbot

安装环境和依赖项

./install

激活环境

conda activate hummingbot

编译代码

./compile

启动 Hummingbot

./start

您应该看到 Hummingbot 欢迎界面:

welcome screen

要开始使用 Hummingbot,请查看以下页面和指南:

开发分支 | 旧版本

如果您需要安装开发分支或 Hummingbot 的旧版本,请执行以下步骤:

开发分支

要使用最新的开发版本,首先克隆仓库,然后切换到 development 分支:

git clone https://github.com/hummingbot/hummingbot.git
cd hummingbot
git checkout development
git pull origin development  # Ensure you have the latest updates

早期版本

要安装特定的旧版本,首先列出可用标签以找到正确的版本:

git tag

一旦确定所需版本(例如 v2.1.0),使用以下命令切换到该版本:

git checkout v2.1.0

早期版本的标签格式如下:vx.x.x(例如 v2.1.0)。


Gateway:DEX 交易必需

去中心化交易所必备

Gateway 必须单独安装才能在这些支持的 DEX 上交易:
- Uniswap (Ethereum)
- PancakeSwap (BNB Chain)
- Trader Joe (Avalanche)
- dYdX (Starkware)
- 以及 30+ 其他平台

Gateway 作为中间件,使 Hummingbot 能够与基于区块链的去中心化交易所进行交互。要进行设置,请按照 Gateway - Installation 中的说明生成证书并将 Gateway 连接到 Hummingbot。