Skip to content

Commit de04ed0

Browse files
guidedwaysclaude
andcommitted
fix: add Python 3.10+ version check to setup scripts
- Add Python version validation in setup.sh and setup.bat - Require Python 3.10 or higher (needed by mcp package) - Provide clear error messages with upgrade instructions - Update README prerequisites and troubleshooting sections This prevents confusing dependency errors when users have older Python versions. 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
1 parent 9619258 commit de04ed0

File tree

3 files changed

+57
-5
lines changed

3 files changed

+57
-5
lines changed

README.md

Lines changed: 14 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,10 @@ All tools accept both individual files and entire directories. The server:
3232

3333
## Quickstart (5 minutes)
3434

35+
### Prerequisites
36+
- **Python 3.10 or higher** (required by the `mcp` package)
37+
- Git
38+
3539
### 1. Get a Gemini API Key
3640
Visit [Google AI Studio](https://makersuite.google.com/app/apikey) and generate an API key. For best results with Gemini 2.5 Pro, use a paid API key as the free tier has limited access to the latest models.
3741

@@ -890,11 +894,16 @@ This error occurs when Claude Desktop (running on Windows) can't properly execut
890894

891895
### Common Issues
892896

893-
**"ModuleNotFoundError: No module named 'mcp'"**
894-
- This means Python dependencies aren't installed
895-
- **Solution**: Run the setup script:
896-
- macOS/Linux: `./setup.sh`
897-
- Windows: `setup.bat`
897+
**"ModuleNotFoundError: No module named 'mcp'" or "No matching distribution found for mcp"**
898+
- This means either:
899+
1. Python dependencies aren't installed - run the setup script
900+
2. Your Python version is too old - the `mcp` package requires Python 3.10+
901+
- **Solution**:
902+
- First check your Python version: `python3 --version` or `python --version`
903+
- If below 3.10, upgrade Python from https://python.org
904+
- Then run the setup script:
905+
- macOS/Linux: `./setup.sh`
906+
- Windows: `setup.bat`
898907
- If you still see this error, manually activate the virtual environment and install:
899908
```bash
900909
# macOS/Linux:

setup.bat

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,31 @@ REM Display Python version
2222
echo Found Python:
2323
python --version
2424

25+
REM Check Python version is at least 3.10
26+
for /f "tokens=2 delims= " %%i in ('python --version 2^>^&1') do set PYTHON_VERSION=%%i
27+
for /f "tokens=1,2 delims=." %%a in ("%PYTHON_VERSION%") do (
28+
set PYTHON_MAJOR=%%a
29+
set PYTHON_MINOR=%%b
30+
)
31+
32+
if %PYTHON_MAJOR% LSS 3 (
33+
goto :pythonTooOld
34+
)
35+
if %PYTHON_MAJOR% EQU 3 if %PYTHON_MINOR% LSS 10 (
36+
goto :pythonTooOld
37+
)
38+
goto :pythonOk
39+
40+
:pythonTooOld
41+
echo Error: Python 3.10 or higher is required (you have Python %PYTHON_VERSION%)
42+
echo.
43+
echo The 'mcp' package requires Python 3.10 or newer.
44+
echo Please download and install Python from https://python.org
45+
echo Make sure to check "Add Python to PATH" during installation.
46+
exit /b 1
47+
48+
:pythonOk
49+
2550
REM Check if venv exists
2651
if exist "venv\" (
2752
echo Virtual environment already exists

setup.sh

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,24 @@ fi
2121
PYTHON_VERSION=$(python3 --version)
2222
echo "✓ Found $PYTHON_VERSION"
2323

24+
# Check Python version is at least 3.10
25+
PYTHON_VERSION_MAJOR=$(python3 -c 'import sys; print(sys.version_info.major)')
26+
PYTHON_VERSION_MINOR=$(python3 -c 'import sys; print(sys.version_info.minor)')
27+
28+
if [ "$PYTHON_VERSION_MAJOR" -lt 3 ] || ([ "$PYTHON_VERSION_MAJOR" -eq 3 ] && [ "$PYTHON_VERSION_MINOR" -lt 10 ]); then
29+
echo "❌ Error: Python 3.10 or higher is required (you have Python $PYTHON_VERSION_MAJOR.$PYTHON_VERSION_MINOR)"
30+
echo ""
31+
echo "The 'mcp' package requires Python 3.10 or newer."
32+
echo "Please upgrade Python from https://python.org"
33+
echo ""
34+
echo "On macOS with Homebrew:"
35+
echo " brew install python@3.12"
36+
echo ""
37+
echo "On Ubuntu/Debian:"
38+
echo " sudo apt update && sudo apt install python3.12 python3.12-venv"
39+
exit 1
40+
fi
41+
2442
# Check if venv exists
2543
if [ -d "venv" ]; then
2644
echo "✓ Virtual environment already exists"

0 commit comments

Comments
 (0)