mirror of
https://github.com/harvard-edge/cs249r_book.git
synced 2026-05-06 09:38:33 -05:00
Windows Git Bash install/setup issues: python3 alias + tito setup self-reinstall (proposed fix) #498
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @adil-mubashir-ch on GitHub (Feb 6, 2026).
Hi Everyone!
I was setting up Tiny Torch on Windows through the quickstart guide (using Git Bash) and ran into some windows-specific issues that werent there when I used WSL. The issues stemmed from the install.sh and setup.py files and I did some local fixes and tested in windows and it seems to be working. Wanted to share that and ask how the best way to contribute that would be. I'll give more context and steps below:
Environment
curl -sSL mlsysbook.ai/tinytorch/install.sh | bashIssue 1: install.sh selects python3 on Windows Git Bash
This caused the creation Unix-style venvs (.venv/bin) instead of Windows (.venv/Scripts)
Fixed this by modifying the get_python_cmd() function to prefer python on Windows
Issue 2: tito setup attempts to reinstall the running CLI on Windows
tito setup currently runs: pip install -e .
This kept giving the error
WinError 32: The process cannot access the file because it is being used by another process:
....venv\Scripts\tito.exe
For this i made two changes
In install.sh
Added a marker file to indicate that tito installation is complete
touch .tinytorch_installedIn the setup.py
On windows if this marker exists skip the installation in install_packages() function
How to Contribute the Change
I wanted to know how I could contribute and whether this approach seems appropriate for the issue. This is my first time contributing to an open source project so I hope this was the right way of discussing the issue. There was an issue that seems to be closed at the moment #1078 so I didnt post there. Hope that wasnt an problem. If The fixes seem fine I'd be happy to open a PR with these changes
@profvjreddi commented on GitHub (Feb 11, 2026):
Hi @adil-mubashir-ch — welcome, and great first contribution! Both issues are real and well-diagnosed. Here are some thoughts:
Issue 1:
python3alias on Windows Git BashGood catch. On Windows,
python3can resolve to the Microsoft Store alias stub instead of the actual Python executable, which then creates Unix-style venv paths. Your fix to preferpythonon Windows inget_python_cmd()makes sense.The installer already detects the platform via
get_platform()and handles the venv activation path difference (lines 483–489), so the Python command selection is the missing piece.Issue 2:
tito.exeself-reinstall lock (WinError 32)This is a classic Windows file-locking issue — you can't overwrite an executable that's currently running. Your diagnosis is correct.
However, the
.tinytorch_installedmarker file approach is a bit fragile (e.g., it persists even if the install is actually stale, and needs cleanup logic). A cleaner approach might be to skip thepip install -e .step ininstall_packages()when:_check_package_installed()for this)Something like:
This avoids the marker file entirely and uses the same package-checking pattern already in the codebase.
Next Steps
Please go ahead and open a PR! For the structure:
site/extra/install.sh— your approach looks good as-istito/commands/setup.py— consider the_check_package_installed()approach above instead of the marker fileHappy to review when it's ready. Thanks for taking the time to document this so thoroughly — really helpful for others hitting the same issue! 🙏
@adil-mubashir-ch commented on GitHub (Feb 12, 2026):
Thank you for the comments @profvjreddi !
I’ve opened a PR with the recommended changes:
https://github.com/harvard-edge/cs249r_book/pull/1169
Glad to be able to contribute to this because I've been following the TinyML resources for several years now and finally got a chance to make a small contribution and give back! Happy to make any additional adjustments if needed.