Files
my-botty/find_python.bat
T
alexpolo1andClaude Opus 4.8 3d12a75b72 feat(install): actionable error messages instead of dead ends
Every fatal message told the user THAT something failed but not what to do
about it. The worst was "conda env create failed. See output above." --
useless when run_install_capture.bat redirects that output to a 56 KB log.

Each error now names the likely cause and the concrete next step:
  - download failed      -> the URL tried, firewall/proxy hint, manual-install
                            fallback that install.bat will detect on re-run
  - truncated download   -> got N bytes vs expected ~78 MB, bad file deleted
  - installer failed     -> antivirus/UAC hint, how to run it by hand
  - conda found but dead -> the exact command to reproduce the real error
  - env create failed    -> disk/network/antivirus causes, plus the
                            "env remove -n botty -y" recovery for a half
                            finished install
  - pip install failed   -> notes the env itself is fine and a re-run resumes
  - python.exe missing   -> explains partial env, gives the recovery commands
  - find_python.bat      -> distinguishes "never installed" from "install.bat
                            did not finish", pointing at the capture log

Added a shared ":fail" exit so every fatal path ends with how to produce a
full log for a bug report, and states that nothing else was changed.

Also added a disk-space pre-flight before env creation: under 3 GB now
fails immediately with a clear message instead of letting conda die halfway
through with an opaque error; 3-6 GB warns. The environment needs ~4 GB
plus ~1 GB of downloads.

Verified: install.bat still completes with exit 0; the pre-flight was
exercised at real, simulated-2 GB and simulated-5 GB levels and all three
branches render and exit correctly; find_python.bat still resolves; 140
tests pass.

Co-Authored-By: Claude Opus 4.8 <[email protected]>
2026-08-06 22:29:23 +02:00

38 lines
1.2 KiB
Batchfile

@echo off
:: Shared conda environment detection for Botty
:: Source this file from your .bat scripts: call find_python.bat
:: On return, %PYTHON% will be set to the botty env python.exe or the script will exit.
if defined PYTHON goto :_find_python_done
for %%C in (
"%LOCALAPPDATA%\miniforge3\envs\botty\python.exe"
"%LOCALAPPDATA%\miniconda3\envs\botty\python.exe"
"%USERPROFILE%\miniforge3\envs\botty\python.exe"
"%USERPROFILE%\miniconda3\envs\botty\python.exe"
"%USERPROFILE%\anaconda3\envs\botty\python.exe"
"%USERPROFILE%\.conda\envs\botty\python.exe"
"C:\ProgramData\miniforge3\envs\botty\python.exe"
"C:\ProgramData\miniconda3\envs\botty\python.exe"
"C:\ProgramData\anaconda3\envs\botty\python.exe"
) do (
if exist %%C (
set "PYTHON=%%~C"
goto :_find_python_done
)
)
echo.
echo ERROR: The 'botty' Python environment is not installed yet.
echo.
echo Fix: double-click install.bat in this folder and wait for
echo "Installation complete!", then try again.
echo.
echo Already ran install.bat? Then it did not finish successfully.
echo Run run_install_capture.bat and check install_log.txt for the error.
echo.
pause
exit /b 1
:_find_python_done