[patch] 修正ks3问题且优化pillow依赖安装时间
This commit is contained in:
@@ -140,19 +140,32 @@ jobs:
|
||||
Write-Host "Step 4.5: Build production executable";
|
||||
Write-Host "==========================================";
|
||||
|
||||
# Ensure PyInstaller and Pillow are in the same Python environment
|
||||
Write-Host "Installing dependencies...";
|
||||
python -m pip install --upgrade pip --quiet;
|
||||
python -m pip install pyinstaller --upgrade --quiet;
|
||||
python -m pip install Pillow --quiet;
|
||||
# Check and install dependencies only if needed
|
||||
Write-Host "Checking dependencies...";
|
||||
|
||||
# Verify installation
|
||||
Write-Host "Python version:";
|
||||
python --version;
|
||||
Write-Host "PyInstaller version:";
|
||||
python -m PyInstaller --version;
|
||||
Write-Host "Pillow version:";
|
||||
python -c "from PIL import Image; print(Image.__version__)";
|
||||
# Check PyInstaller
|
||||
$pyinstallerInstalled = python -c "try: import PyInstaller; print('installed')`nexcept: print('not-installed')" 2>$null;
|
||||
if ($pyinstallerInstalled -ne "installed") {
|
||||
Write-Host "Installing PyInstaller...";
|
||||
python -m pip install pyinstaller --quiet;
|
||||
} else {
|
||||
Write-Host "PyInstaller: already installed";
|
||||
}
|
||||
|
||||
# Check Pillow
|
||||
$pillowInstalled = python -c "try: from PIL import Image; print('installed')`nexcept: print('not-installed')" 2>$null;
|
||||
if ($pillowInstalled -ne "installed") {
|
||||
Write-Host "Installing Pillow...";
|
||||
python -m pip install Pillow --quiet;
|
||||
} else {
|
||||
Write-Host "Pillow: already installed";
|
||||
}
|
||||
|
||||
Write-Host "";
|
||||
Write-Host "Environment ready:";
|
||||
Write-Host " Python:" (python --version);
|
||||
Write-Host " PyInstaller:" (python -m PyInstaller --version);
|
||||
Write-Host " Pillow:" (python -c "from PIL import Image; print(Image.__version__)");
|
||||
Write-Host "";
|
||||
|
||||
python build_production.py;
|
||||
|
||||
Reference in New Issue
Block a user