151 lines
3.7 KiB
Batchfile
151 lines
3.7 KiB
Batchfile
@echo off
|
|
echo FLUX.1 Edit MCP Server - Troubleshooting
|
|
echo =======================================
|
|
|
|
echo 1. Checking Python installation...
|
|
python --version
|
|
if errorlevel 1 (
|
|
echo [ERROR] Python is not installed or not in PATH
|
|
goto :end
|
|
) else (
|
|
echo [OK] Python is available
|
|
)
|
|
|
|
echo.
|
|
echo 2. Checking pip installation...
|
|
pip --version
|
|
if errorlevel 1 (
|
|
echo [ERROR] pip is not available
|
|
goto :end
|
|
) else (
|
|
echo [OK] pip is available
|
|
)
|
|
|
|
echo.
|
|
echo 3. Checking virtual environment...
|
|
if exist "venv" (
|
|
echo [OK] Virtual environment directory exists
|
|
call venv\Scripts\activate.bat
|
|
if errorlevel 1 (
|
|
echo [ERROR] Cannot activate virtual environment
|
|
goto :end
|
|
) else (
|
|
echo [OK] Virtual environment activated
|
|
)
|
|
) else (
|
|
echo [WARNING] Virtual environment not found
|
|
echo Creating virtual environment...
|
|
python -m venv venv
|
|
if errorlevel 1 (
|
|
echo [ERROR] Failed to create virtual environment
|
|
goto :end
|
|
)
|
|
call venv\Scripts\activate.bat
|
|
echo [OK] Virtual environment created and activated
|
|
)
|
|
|
|
echo.
|
|
echo 4. Checking Python in virtual environment...
|
|
where python
|
|
python --version
|
|
|
|
echo.
|
|
echo 5. Checking critical dependencies...
|
|
python -c "import aiohttp; print(f'aiohttp: {aiohttp.__version__}')" 2>nul
|
|
if errorlevel 1 (
|
|
echo [ERROR] aiohttp not found - installing...
|
|
pip install aiohttp==3.11.7
|
|
) else (
|
|
echo [OK] aiohttp is available
|
|
)
|
|
|
|
python -c "import httpx; print(f'httpx: {httpx.__version__}')" 2>nul
|
|
if errorlevel 1 (
|
|
echo [ERROR] httpx not found - installing...
|
|
pip install httpx==0.28.1
|
|
) else (
|
|
echo [OK] httpx is available
|
|
)
|
|
|
|
python -c "import mcp" 2>nul
|
|
if errorlevel 1 (
|
|
echo [ERROR] mcp not found - installing...
|
|
pip install mcp==1.1.0
|
|
) else (
|
|
echo [OK] mcp is available
|
|
)
|
|
|
|
python -c "from PIL import Image; print('Pillow: available')" 2>nul
|
|
if errorlevel 1 (
|
|
echo [ERROR] Pillow not found - installing...
|
|
pip install Pillow==11.0.0
|
|
) else (
|
|
echo [OK] Pillow is available
|
|
)
|
|
|
|
echo.
|
|
echo 6. Checking configuration files...
|
|
if exist ".env" (
|
|
echo [OK] .env file exists
|
|
) else (
|
|
echo [WARNING] .env file not found
|
|
if exist ".env.example" (
|
|
echo Creating .env from example...
|
|
copy .env.example .env
|
|
echo [OK] .env file created from example
|
|
) else (
|
|
echo [ERROR] .env.example file not found
|
|
)
|
|
)
|
|
|
|
echo.
|
|
echo 7. Checking required directories...
|
|
if not exist "input_images" mkdir input_images & echo [OK] Created input_images directory
|
|
if not exist "generated_images" mkdir generated_images & echo [OK] Created generated_images directory
|
|
if not exist "temp" mkdir temp & echo [OK] Created temp directory
|
|
|
|
echo.
|
|
echo 8. Testing basic imports...
|
|
python -c "
|
|
import sys
|
|
print(f'Python executable: {sys.executable}')
|
|
print(f'Python version: {sys.version}')
|
|
print('Testing imports...')
|
|
try:
|
|
import aiohttp
|
|
print('✓ aiohttp imported successfully')
|
|
except ImportError as e:
|
|
print(f'✗ aiohttp import failed: {e}')
|
|
|
|
try:
|
|
import mcp
|
|
print('✓ mcp imported successfully')
|
|
except ImportError as e:
|
|
print(f'✗ mcp import failed: {e}')
|
|
|
|
try:
|
|
from src.connector import Config
|
|
print('✓ Local Config imported successfully')
|
|
except ImportError as e:
|
|
print(f'✗ Local Config import failed: {e}')
|
|
|
|
try:
|
|
from src.server import main
|
|
print('✓ Local server main imported successfully')
|
|
except ImportError as e:
|
|
print(f'✗ Local server main import failed: {e}')
|
|
"
|
|
|
|
echo.
|
|
echo Troubleshooting complete!
|
|
echo.
|
|
echo If you still have issues:
|
|
echo 1. Delete venv folder and run install_dependencies.bat
|
|
echo 2. Make sure you have a stable internet connection
|
|
echo 3. Check if your antivirus is blocking Python/pip
|
|
echo 4. Try running as administrator
|
|
echo.
|
|
|
|
:end
|
|
pause
|