warbler-cda / VSCODE_TROUBLESHOOTING.md
Bellok
feat(docs, refactor): add NPC Chat API integration guide and update data ingestion
ec2d906
|
raw
history blame
2.16 kB

VS Code Python Environment Troubleshooting

Issue

VS Code Python extension cannot resolve/activate the project environment, showing errors like:

  • "Failed to resolve env '\python'"
  • Environment initialization failures

Root Cause

VS Code's Python extension has cached stale configuration or conflicting settings from previous environment attempts.

Solutions Applied

1. Virtual Environment Recreatd βœ…

  • Created fresh virtual environment: python -m venv venv
  • Installed dependencies: pip install -e .[dev]
  • Environment verified working with tests

2. VS Code Configuration Cleaned βœ…

  • Updated python.defaultInterpreterPath to absolute path
  • Cleared conflicting environment manager settings
  • Simplified configuration to use the virtual environment directly

3. VS Code Cache Cleared βœ…

  • Removed workspace storage cache for warbler projects
  • Extensions reinstalled fresh

Next Steps

IMMEDIATE ACTION REQUIRED - Complete VS Code Reset

  1. Exit VS Code Completely

    • Close all VS Code windows
    • Ensure no VS Code processes running (check Task Manager)
  2. Clear Extension Host Logs (Optional but recommended)

    Delete: %APPDATA%\Code\logs
    
  3. Clear Extension Storage (Optional but recommended)

    Delete: %APPDATA%\Code\User\workspaceStorage\<warbler-folders>
    
  4. Restart VS Code

    • Open VS Code again
    • Open the warbler-cda folder
    • Wait for Python extension to initialize

Expected Behavior After Reset

  • Python interpreter in status bar should show: venv\Scripts\python.exe
  • No environment resolution errors
  • IntelliSense and syntax highlighting should work
  • Tests should run from VS Code test explorer

If Still Not Working

Try manually selecting interpreter:

  1. Click Python version in status bar
  2. Select "Enter interpreter path..."
  3. Navigate to: C:\Users\jerio\RiderProjects\warbler-cda\venv\Scripts\python.exe

Verification Command

venv\Scripts\python.exe --version

Should return: Python 3.12.10

Test Command

venv\Scripts\python.exe -m pytest tests/test_data_ingestion.py -v

Should run tests successfully.