开发环境搭建

构建和运行 PyriteIDE 的开发环境。

前置要求

工具版本
Flutter SDK3.44.4
Dart SDK3.12.2
Python3.14(推荐)
Git2.x
git clone --recursive https://github.com/pyrite-project/pyrite-ide.git
cd pyrite-ide
flutter pub get

windows 替换为 linuxmacos 或可用的 Android 设备 ID。若仓库不是通过 --recursive 克隆,请先执行:

git submodule update --init --recursive

首先请设置 SERIOUS_PYTHON_SITE_PACKAGES 环境变量,请将 ... 处替换为项目根目录:

export SERIOUS_PYTHON_SITE_PACKAGES=".../assets/python_runtime_boot"

针对你的目标平台,打包 python_runtime_boot.zip,这里以 Linux 为例:

dart run serious_python:main package "assets/python_runtime_boot" --platform Linux --asset "assets/python_runtime_boot.zip" --verbose

运行命令开始编译:

flutter build linux --release --verbose

其中的 --release--verbose 均为可选参数,须特别注意,若目标平台为 AndroidMacOS,须传入 --no-tree-shake-icons 参数

项目结构

pyrite_ide/
├── lib/
│   ├── main.dart
│   ├── app/
│   ├── core/
│   ├── pages/
│   ├── shared/
│   └── features/
├── test/
├── assets/
├── android/
├── linux/
├── macos/
├── windows/
├── flserial/          # 串口本地依赖
├── python_runtime/    # Python 运行时本地依赖
└── third_party/       # 第三方依赖

本地依赖

依赖说明
flserial串口通信封装
python_runtime嵌入式 Python 运行时

更多第三方库不做阐述,请参考 pubspec.yaml 文件。

常见问题

Flutter 分析报错

确认所有本地依赖已同步:

flutter pub get

Python 运行时未找到

确认 python_runtime/ 目录存在且包含运行时文件。

On this page