开发环境搭建
构建和运行 PyriteIDE 的开发环境。
前置要求
| 工具 | 版本 |
|---|---|
| Flutter SDK | 3.44.4 |
| Dart SDK | 3.12.2 |
| Python | 3.14(推荐) |
| Git | 2.x |
git clone --recursive https://github.com/pyrite-project/pyrite-ide.git
cd pyrite-ide
flutter pub get将 windows 替换为 linux、macos 或可用的 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 均为可选参数,须特别注意,若目标平台为 Android 或 MacOS,须传入 --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 getPython 运行时未找到
确认 python_runtime/ 目录存在且包含运行时文件。