1.8 KiB
1.8 KiB
asyncmy 离线安装说明
本目录用于给无法联网的后端服务器补装 MySQL 异步驱动 asyncmy==0.2.11。
项目的 pyproject.toml 已经声明该依赖;服务器启动报 MySQL async driver is not installed,说明实际运行后端的 Python 虚拟环境尚未安装它。
文件选择
asyncmy-0.2.11-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl:Ubuntu、CentOS、RHEL、Debian 等常见 glibc Linux(x86_64)。asyncmy-0.2.11-cp312-cp312-musllinux_1_2_x86_64.whl:Alpine Linux(x86_64)。
这两个 wheel 都只适用于 CPython 3.12、x86_64。在服务器执行 python -V 和 uname -m 确认:应分别显示 Python 3.12 和 x86_64/amd64。
安装步骤
-
将整个
offline-wheels目录复制到后端目录(与pyproject.toml同级)。 -
进入后端实际运行的虚拟环境;若项目使用默认虚拟环境:
cd /path/to/backend source .venv/bin/activate -
普通 Linux(Ubuntu/CentOS/RHEL/Debian)执行:
python -m pip install --no-index ./offline-wheels/asyncmy/asyncmy-0.2.11-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whlAlpine Linux 则执行:
python -m pip install --no-index ./offline-wheels/asyncmy/asyncmy-0.2.11-cp312-cp312-musllinux_1_2_x86_64.whl -
验证:
python -c "import asyncmy; print(asyncmy.__version__)" -
重启后端服务。
注意事项
- 必须使用启动后端服务的同一个 Python/虚拟环境安装,系统 Python 安装成功并不代表服务能找到该包。
- 不要使用
--force-reinstall;安装缺失的asyncmy即可。 - 若服务器是 Python 3.13、ARM/aarch64,或不是上述 Linux 类型,请不要安装本目录 wheel,需要下载对应平台版本。