从源码运行 mower-ng
本文介绍如何从源码运行 mower-ng。
Python 3.12
从 Python 官网下载 3.12.7 版本并安装:
https://www.python.org/ftp/python/3.12.7/python-3.12.7-amd64.exe
Ubuntu 24.04 自带 Python 3.12.3,直接安装即可:1
sudo apt install python3-venv python3-tk python3-dev
对于其它版本的 Ubuntu,可通过 deadsnakes ppa 安装:1
2sudo add-apt-repository ppa:deadsnakes/ppa
sudo apt install python3.12 python3.12-venv python3.12-tk python3.12-dev
使用 Homebrew 安装 Python 3.12:1
brew install python@3.12 python-tk@3.12
其它依赖
- Git:https://git-scm.com/download/win
- Microsoft Visual C++ 2013 Redistributable:https://aka.ms/highdpimfc2013x64enu
- Microsoft Visual C++ 2015-2022 Redistributable:https://aka.ms/vs/17/release/vc_redist.x64.exe
- Microsoft Edge WebView2:https://go.microsoft.com/fwlink/p/?LinkId=2124703
1 | sudo apt install libgirepository1.0-dev gcc libcairo2-dev pkg-config gir1.2-webkit2-4.1 gir1.2-appindicator3-0.1 libzbar0 adb git |
1 | brew install zbar |
下载代码
1 | git lfs install |
Python 依赖
建立并激活虚拟环境,安装依赖。
如果在安装 Python 时未将其加入 PATH,则需手动指定完整路径。默认安装路径为 %LocalAppData%\Programs\Python\Python312
。1
2
3%LocalAppData%\Programs\Python\Python312\python -m venv venv
venv\Scripts\activate
pip install -r requirements.txt
1 | python3.12 -m venv venv |
1 | $(brew --prefix)/opt/python@3.12/libexec/bin/python -m venv venv |
运行
1 | python webview_ui.py |
1 | ./webview_ui.py |
1 | ./webview_ui.py |