安装基础依赖包
pip3 install pydub pip3 install loguru pip3 install pandas安装docx依赖
① 先用 apt 装系统 lxml(通常是有的)
sudo apt updatesudo apt install -y python3-lxml② 再用 pip 装 python-docx(不装依赖)
pip3 install python-docx --no-deps👉 因为:
python-docx本身是纯 Python依赖只有
lxml我们已经提前解决了
lxml
安装LibreOffice
如果这台 sophon 机器允许装软件,直接:
sudo apt install -y libreoffice或者精简一点(只要转 PDF):
sudo apt install -y libreoffice-writer验证:
which libreoffice libreoffice --version正常安装特别慢,建议换国内 ARM 镜像源(立刻提速)
ports.ubuntu.com在国内基本必慢,
必须换成清华 / 阿里 / 中科大 ARM ports 镜像。
⭐ 推荐:清华 TUNA(ARM 支持最好)
1️⃣ 备份原 sources.list
sudo cp /etc/apt/sources.list /etc/apt/sources.list.bak2️⃣ 替换为清华 ARM ports 源
sudo nano /etc/apt/sources.list全部替换为:
deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu-ports/ focal main universe multiverse restricted deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu-ports/ focal-updates main universe multiverse restricted deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu-ports/ focal-security main universe multiverse restricted保存退出。
3️⃣ 更新 + 继续安装(断点续下)
sudo apt clean sudo apt update sudo apt install -y libreoffice-writer⚠️强烈建议用
libreoffice-writer,别装全家桶 libreoffice
转 docx → pdf只需要 writer
体积小很多(但还是不小)
👉 一般会从kB/s → MB/s
安装字体
解压目录下的字体
unzip SourceHanSansSC.zipsudo mkdir -p /usr/share/fonts/source-han-sans sudo cp SourceHanSansSC/*.otf /usr/share/fonts/source-han-sans/3️⃣ 刷新字体缓存(非常关键)
sudo fc-cache -fv4️⃣ 验证系统是否识别成功
fc-list | grep "Source Han Sans"