這篇整理我實際測過的 manga-image-translator 安裝流程,目標是讓你在 Windows + NVIDIA GPU 環境,盡量一次把漫畫翻譯服務跑起來。
官方文件連結:
先看這段
如果你不是軟體工程背景,建議先安裝好以下工具再往下做:
- Git
- Visual Studio Build Tools(安裝時勾選 Desktop development with C++)
- 顯示卡驅動與 CUDA 對應版本
版本與環境說明
- 系統:Windows
- Python 環境管理:
uv
- 測試時參考 commit:
ff48a122fd0b4016e00877f3cf5933db2a98b9d0
版本提醒
manga-image-translator 更新很快,不同時間點的依賴會變動。如果你照最新版本失敗,可以先切到上面那個 commit 版本驗證流程。
安裝步驟
1. 複製專案
1
2
|
git clone https://github.com/zyddnys/manga-image-translator.git
cd .\manga-image-translator\
|
2. 建立並啟用虛擬環境
1
2
|
uv venv
.venv\Scripts\activate
|
3. 安裝 PyTorch(CUDA 12.6)
1
|
uv pip install torch torchvision torchaudio --index-url https://download.pytorch.org/whl/cu126
|
4. 安裝 PaddlePaddle(CUDA 12.6)
1
|
uv pip install paddlepaddle-gpu==3.0.0 -i https://www.paddlepaddle.org.cn/packages/stable/cu126/
|
5. 安裝主要依賴
先把以下內容存成 requirements.local.txt(或直接更新專案內 requirements.txt):
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
|
networkx
torch
groq
torchvision
torch-summary
einops
scikit-image
opencv-python
pyclipper
shapely
requests
cryptography
freetype-py
aiohttp
tqdm
deepl
ImageHash
kornia
backports.cached-property
huggingface_hub
transformers
py3langid==0.2.2
sentencepiece
editdistance
numpy==1.26.4
tensorboardX
websockets
protobuf<6.0.0,>=3.20.2
ctranslate2==4.6.0
colorama
openai==1.63.0
tiktoken
httpx==0.27.2
open_clip_torch
safetensors
pandas
onnxruntime
timm
omegaconf
python-dotenv
nest-asyncio
marshmallow
cython
aioshutil
aiofiles
arabic-reshaper
pyhyphen
langcodes
manga-ocr
langdetect
pydensecrf@git+https://github.com/lucasb-eyer/pydensecrf.git
accelerate
bitsandbytes
uvicorn
fastapi
pydantic==2.5.0
python-multipart
google-genai
rich
regex
paddleocr
paddlepaddle
|
安裝指令:
1
|
uv pip install -r requirements.local.txt
|
6. 若你要沿用原始 requirements.txt
建議先確認以下幾個差異:
1
2
3
4
5
6
7
8
9
|
- ctranslate2<=3.24.0
+ ctranslate2==4.6.0
- pydensecrf@https://github.com/lucasb-eyer/pydensecrf/archive/refs/heads/master.zip
+ pydensecrf@git+https://github.com/lucasb-eyer/pydensecrf.git
- --extra-index-url https://www.paddlepaddle.org.cn/packages/stable/cu118/
- --extra-index-url https://www.paddlepaddle.org.cn/packages/stable/cu123/
+ (移除,改由上方指令明確安裝 cu126 版本)
|
啟動服務
1
2
|
cd server
uv run main.py --use-gpu
|
啟動後開啟:http://localhost:8080
我實測時,官方 UI 可以正常開啟。翻譯模型推薦先用 Qwen2_big,有些模型目前不一定能穩定使用。
硬體方面,RTX 2060 可能會遇到顯示記憶體壓力,RTX 4070 Ti 執行比較順。
常見錯誤排除
Microsoft Visual C++ 14.0 or greater is required
如果安裝 pydensecrf 時看到這段錯誤,核心問題是你缺少 C++ 編譯工具鏈。
錯誤關鍵訊息:
1
|
error: Microsoft Visual C++ 14.0 or greater is required.
|
解法:
- 前往 Microsoft Visual C++ Build Tools 官方網站
- 下載並安裝 Build Tools
- 安裝時勾選 Desktop development with C++
- 安裝完成後,重新開啟終端機
- 再次執行
uv pip install -r requirements.local.txt
小提醒
若你已經安裝 Build Tools 仍失敗,可以確認是否安裝到 MSVC v14.x 與 Windows SDK,這兩個元件通常都需要。