马一丁

New Version Dependency Name

@@ -42,6 +42,10 @@ export DYLD_LIBRARY_PATH=/usr/local/lib:$DYLD_LIBRARY_PATH @@ -42,6 +42,10 @@ export DYLD_LIBRARY_PATH=/usr/local/lib:$DYLD_LIBRARY_PATH
42 echo 'export DYLD_LIBRARY_PATH=/opt/homebrew/lib:$DYLD_LIBRARY_PATH' >> ~/.zshrc 42 echo 'export DYLD_LIBRARY_PATH=/opt/homebrew/lib:$DYLD_LIBRARY_PATH' >> ~/.zshrc
43 # Intel users: echo 'export DYLD_LIBRARY_PATH=/usr/local/lib:$DYLD_LIBRARY_PATH' >> ~/.zshrc 43 # Intel users: echo 'export DYLD_LIBRARY_PATH=/usr/local/lib:$DYLD_LIBRARY_PATH' >> ~/.zshrc
44 source ~/.zshrc 44 source ~/.zshrc
  45 +
  46 +# 3. Verify in a new terminal
  47 +python -m ReportEngine.utils.dependency_check
  48 +# You should see “✓ Pango dependency check passed”
45 ``` 49 ```
46 50
47 </details> 51 </details>
@@ -53,11 +57,17 @@ source ~/.zshrc @@ -53,11 +57,17 @@ source ~/.zshrc
53 # 1. Install system dependencies (execute on host machine) 57 # 1. Install system dependencies (execute on host machine)
54 sudo apt-get update 58 sudo apt-get update
55 sudo apt-get install -y \ 59 sudo apt-get install -y \
56 - libpango-1.0-0 \  
57 - libpangoft2-1.0-0 \  
58 - libgdk-pixbuf2.0-0 \  
59 - libffi-dev \  
60 - libcairo2 60 + libpango-1.0-0 \
  61 + libpangoft2-1.0-0 \
  62 + libffi-dev \
  63 + libcairo2
  64 +
  65 +# Prefer the newer package name; fall back if your repo doesn't provide it
  66 +if sudo apt-cache show libgdk-pixbuf-2.0-0 >/dev/null 2>&1; then
  67 + sudo apt-get install -y libgdk-pixbuf-2.0-0
  68 +else
  69 + sudo apt-get install -y libgdk-pixbuf2.0-0
  70 +fi
61 ``` 71 ```
62 72
63 </details> 73 </details>
@@ -73,4 +83,4 @@ sudo yum install -y pango gdk-pixbuf2 libffi-devel cairo @@ -73,4 +83,4 @@ sudo yum install -y pango gdk-pixbuf2 libffi-devel cairo
73 </details> 83 </details>
74 84
75 85
76 -> **Tip**: If using Docker deployment, no need to manually install these dependencies, the Docker image already contains all necessary system dependencies.  
  86 +> **Tip**: If using Docker deployment, no need to manually install these dependencies, the Docker image already contains all necessary system dependencies.
@@ -28,8 +28,6 @@ python -m ReportEngine.utils.dependency_check @@ -28,8 +28,6 @@ python -m ReportEngine.utils.dependency_check
28 <details> 28 <details>
29 <summary><b> macOS 系统安装步骤</b></summary> 29 <summary><b> macOS 系统安装步骤</b></summary>
30 30
31 -> **重要提示**:macOS 用户必须完成以下**两个步骤**,缺一不可!仅安装系统依赖而不设置环境变量会导致 `cannot load library 'libgobject-2.0-0'` 错误。  
32 -  
33 ```bash 31 ```bash
34 # 步骤 1: 安装系统依赖 32 # 步骤 1: 安装系统依赖
35 brew install pango gdk-pixbuf libffi 33 brew install pango gdk-pixbuf libffi
@@ -46,14 +44,10 @@ echo 'export DYLD_LIBRARY_PATH=/opt/homebrew/lib:$DYLD_LIBRARY_PATH' >> ~/.zshrc @@ -46,14 +44,10 @@ echo 'export DYLD_LIBRARY_PATH=/opt/homebrew/lib:$DYLD_LIBRARY_PATH' >> ~/.zshrc
46 # Intel 用户请改为: 44 # Intel 用户请改为:
47 # echo 'export DYLD_LIBRARY_PATH=/usr/local/lib:$DYLD_LIBRARY_PATH' >> ~/.zshrc 45 # echo 'export DYLD_LIBRARY_PATH=/usr/local/lib:$DYLD_LIBRARY_PATH' >> ~/.zshrc
48 source ~/.zshrc 46 source ~/.zshrc
49 -```  
50 -  
51 -**验证安装**  
52 47
53 -```bash  
54 -# 测试 PDF 依赖是否正确配置 48 +# 步骤 3: 验证(请在新终端执行)
55 python -m ReportEngine.utils.dependency_check 49 python -m ReportEngine.utils.dependency_check
56 -# 应该显示:✓ Pango 依赖检测通过,PDF 导出功能可用 50 +# 输出包含 “✓ Pango 依赖检测通过” 表示配置正确
57 ``` 51 ```
58 52
59 **常见问题** 53 **常见问题**
@@ -72,11 +66,17 @@ python -m ReportEngine.utils.dependency_check @@ -72,11 +66,17 @@ python -m ReportEngine.utils.dependency_check
72 # 1. 安装系统依赖(在宿主机上执行) 66 # 1. 安装系统依赖(在宿主机上执行)
73 sudo apt-get update 67 sudo apt-get update
74 sudo apt-get install -y \ 68 sudo apt-get install -y \
75 - libpango-1.0-0 \  
76 - libpangoft2-1.0-0 \  
77 - libgdk-pixbuf2.0-0 \  
78 - libffi-dev \  
79 - libcairo2 69 + libpango-1.0-0 \
  70 + libpangoft2-1.0-0 \
  71 + libffi-dev \
  72 + libcairo2
  73 +
  74 +# 优先使用新包名,若仓库缺失则回退
  75 +if sudo apt-cache show libgdk-pixbuf-2.0-0 >/dev/null 2>&1; then
  76 + sudo apt-get install -y libgdk-pixbuf-2.0-0
  77 +else
  78 + sudo apt-get install -y libgdk-pixbuf2.0-0
  79 +fi
80 ``` 80 ```
81 81
82 </details> 82 </details>
@@ -92,4 +92,3 @@ sudo yum install -y pango gdk-pixbuf2 libffi-devel cairo @@ -92,4 +92,3 @@ sudo yum install -y pango gdk-pixbuf2 libffi-devel cairo
92 </details> 92 </details>
93 93
94 > **提示**:如果使用 Docker 部署,无需手动安装这些依赖,Docker 镜像已包含所有必要的系统依赖。 94 > **提示**:如果使用 Docker 部署,无需手动安装这些依赖,Docker 镜像已包含所有必要的系统依赖。
95 -