|
3475 | 3475 | " print(f\"❌ Python not found at: {python_path}\")\n", |
3476 | 3476 | " print(\" Make sure virtual environment is set up (Step 3)\")\n", |
3477 | 3477 | " return False\n", |
3478 | | - " \n", |
| 3478 | + "\n", |
| 3479 | + " chk = subprocess.run(\n", |
| 3480 | + " [str(python_path), \"-c\", \"import asyncpg, bcrypt, dotenv\"],\n", |
| 3481 | + " capture_output=True,\n", |
| 3482 | + " text=True,\n", |
| 3483 | + " cwd=str(project_root),\n", |
| 3484 | + " )\n", |
| 3485 | + " if chk.returncode != 0:\n", |
| 3486 | + " print(\"📦 Project venv missing packages for user script; installing asyncpg, bcrypt, python-dotenv...\")\n", |
| 3487 | + " ins = subprocess.run(\n", |
| 3488 | + " [\n", |
| 3489 | + " str(python_path),\n", |
| 3490 | + " \"-m\",\n", |
| 3491 | + " \"pip\",\n", |
| 3492 | + " \"install\",\n", |
| 3493 | + " \"asyncpg>=0.29\",\n", |
| 3494 | + " \"bcrypt\",\n", |
| 3495 | + " \"python-dotenv\",\n", |
| 3496 | + " ],\n", |
| 3497 | + " cwd=str(project_root),\n", |
| 3498 | + " )\n", |
| 3499 | + " if ins.returncode != 0:\n", |
| 3500 | + " print(f\"❌ pip install failed (need network). Try: {python_path} -m pip install -r requirements.txt\")\n", |
| 3501 | + " return False\n", |
| 3502 | + " print(\" ✅ Installed\")\n", |
| 3503 | + "\n", |
3479 | 3504 | " print(\"\\n🔄 Running user creation script...\")\n", |
3480 | 3505 | " result = subprocess.run(\n", |
3481 | 3506 | " [str(python_path), str(script_path)],\n", |
|
3590 | 3615 | " print(\" Make sure virtual environment is set up (Step 3)\")\n", |
3591 | 3616 | " return False\n", |
3592 | 3617 | "\n", |
| 3618 | + " chk = subprocess.run(\n", |
| 3619 | + " [str(python_path), \"-c\", \"import asyncpg, psycopg, bcrypt, numpy\"],\n", |
| 3620 | + " capture_output=True,\n", |
| 3621 | + " text=True,\n", |
| 3622 | + " cwd=str(project_root),\n", |
| 3623 | + " )\n", |
| 3624 | + " if chk.returncode != 0:\n", |
| 3625 | + " print(\"📦 Project venv missing packages for demo scripts; installing asyncpg, psycopg, bcrypt, numpy...\")\n", |
| 3626 | + " ins = subprocess.run(\n", |
| 3627 | + " [\n", |
| 3628 | + " str(python_path),\n", |
| 3629 | + " \"-m\",\n", |
| 3630 | + " \"pip\",\n", |
| 3631 | + " \"install\",\n", |
| 3632 | + " \"asyncpg>=0.29\",\n", |
| 3633 | + " \"psycopg[binary]>=3\",\n", |
| 3634 | + " \"bcrypt\",\n", |
| 3635 | + " \"numpy>=1.24\",\n", |
| 3636 | + " ],\n", |
| 3637 | + " cwd=str(project_root),\n", |
| 3638 | + " )\n", |
| 3639 | + " if ins.returncode != 0:\n", |
| 3640 | + " print(f\"❌ pip install failed (need network). Try: {python_path} -m pip install -r requirements.txt\")\n", |
| 3641 | + " return False\n", |
| 3642 | + " print(\" ✅ Installed\")\n", |
| 3643 | + "\n", |
3593 | 3644 | " scripts = [\n", |
3594 | 3645 | " (\"scripts/data/quick_demo_data.py\", \"Quick demo data (equipment, inventory)\"),\n", |
3595 | 3646 | " (\"scripts/data/generate_historical_demand.py\", \"Historical demand data (for forecasting)\"),\n", |
|
0 commit comments