Skip to content

Commit 4770e54

Browse files
author
shadeform
committed
fix(setup): run create_default_users with project venv and cwd
Step 8 used CWD-relative env/bin/python, so notebooks opened from a parent directory could invoke the wrong interpreter (missing asyncpg). Use project_root for the venv path, set subprocess cwd to project_root for .env loading, and clarify manual recovery commands. Made-with: Cursor
1 parent 928b492 commit 4770e54

1 file changed

Lines changed: 7 additions & 5 deletions

File tree

notebooks/setup/complete_setup_guide.ipynb

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3391,11 +3391,11 @@
33913391
" print(f\"❌ Script not found: {script_path}\")\n",
33923392
" return False\n",
33933393
" \n",
3394-
" # Determine Python path\n",
3394+
" # Project venv (not CWD-relative — notebook may run from a parent directory)\n",
33953395
" if sys.platform == \"win32\":\n",
3396-
" python_path = Path(\"env\") / \"Scripts\" / \"python.exe\"\n",
3396+
" python_path = project_root / \"env\" / \"Scripts\" / \"python.exe\"\n",
33973397
" else:\n",
3398-
" python_path = Path(\"env\") / \"bin\" / \"python\"\n",
3398+
" python_path = project_root / \"env\" / \"bin\" / \"python\"\n",
33993399
" \n",
34003400
" if not python_path.exists():\n",
34013401
" print(f\"❌ Python not found at: {python_path}\")\n",
@@ -3406,7 +3406,8 @@
34063406
" result = subprocess.run(\n",
34073407
" [str(python_path), str(script_path)],\n",
34083408
" capture_output=True,\n",
3409-
" text=True\n",
3409+
" text=True,\n",
3410+
" cwd=str(project_root),\n",
34103411
" )\n",
34113412
" \n",
34123413
" if result.returncode == 0:\n",
@@ -3418,7 +3419,8 @@
34183419
" else:\n",
34193420
" print(f\"❌ Failed to create users: {result.stderr}\")\n",
34203421
" print(\"\\n💡 Try running manually:\")\n",
3421-
" print(f\" source env/bin/activate # or env\\\\Scripts\\\\activate on Windows\")\n",
3422+
" print(f\" cd {project_root}\")\n",
3423+
" print(\" source env/bin/activate # or env\\\\Scripts\\\\activate on Windows\")\n",
34223424
" print(f\" python {script_path}\")\n",
34233425
" return False\n",
34243426
"\n",

0 commit comments

Comments
 (0)