Windows Troubleshooting Guide¶
This guide helps Windows users resolve common issues when installing and running CodexSpec.
Problem: "spawn codexspec access denied" (OSError 5) in CMD¶
Symptoms¶
- Running
codexspec --versionorcodexspec initin CMD fails with "Access denied" or "spawn codexspec access denied (OSError 5)" - The same commands work correctly in PowerShell
Root Cause¶
This is caused by differences in how Windows CMD and PowerShell handle user environment variables:
-
PATH environment variable refresh: When uv installs codexspec, it adds
%USERPROFILE%\.local\binto the user PATH. PowerShell typically recognizes this immediately, while CMD may not refresh the environment variables until the terminal is restarted. -
Process creation differences: CMD uses Windows CreateProcess API, while PowerShell uses a different mechanism that may be more tolerant of path resolution issues.
Solutions¶
Solution 1: Use PowerShell (Recommended)¶
The simplest solution is to use PowerShell instead of CMD:
Solution 2: Restart CMD¶
Close all CMD windows and open a fresh one. This forces CMD to reload environment variables.
Solution 3: Manually Refresh PATH in CMD¶
# Add uv's bin directory to PATH for the current session
set PATH=%PATH%;%USERPROFILE%\.local\bin
# Verify
codexspec --version
Solution 4: Use Full Path¶
Solution 5: Add to System PATH Permanently¶
- Open System Properties → Environment Variables
- Find
Pathin User variables or System variables - Add:
%USERPROFILE%\.local\bin - Click OK and restart all terminals
Solution 6: Use pipx Instead of uv tool¶
If uv continues to have issues, use pipx as an alternative:
# Install pipx
pip install pipx
pipx ensurepath
# Restart CMD, then install codexspec
pipx install codexspec
# Verify
codexspec --version
Verification Steps¶
To diagnose the issue, run these commands in CMD:
# Check if uv's bin directory is in PATH
echo %PATH% | findstr ".local\bin"
# Check if codexspec executable exists
dir %USERPROFILE%\.local\bin\codexspec.*
# Try running with full path
%USERPROFILE%\.local\bin\codexspec.exe --version
Common Issues¶
Issue: "uv is not recognized"¶
Cause: uv is not installed or not in PATH.
Solution:
# Install uv using PowerShell
powershell -c "irm https://astral.sh/uv/install.ps1 | iex"
# Restart terminal and verify
uv --version
Issue: "python is not recognized"¶
Cause: Python is not installed or not in PATH.
Solution:
- Install Python 3.11+ from python.org
- During installation, check "Add Python to PATH"
- Restart terminal
Issue: Antivirus Blocking Execution¶
Symptoms: Codexspec works briefly then stops, or shows intermittent errors.
Solution: Add codexspec to your antivirus whitelist:
- Windows Defender: Settings → Update & Security → Windows Security → Virus & threat protection → Manage settings → Exclusions
- Add path:
%USERPROFILE%\.local\bin\codexspec.exe
Related Resources¶
- uv GitHub Issue #16747 - Known Windows permission issues with uv
- uv Windows Installation Guide
- pipx Documentation - Alternative Python application installer