Skip to content

Commit dc70272

Browse files
ryanmacclaude
andcommitted
fix: improve pyenv and Poetry detection in universal installer
- Add functional check for Poetry (poetry --version) before using it - Detect pyenv and warn users about potential version mismatches - Provide helpful error messages suggesting pyenv version switches - Update README with clearer pyenv prerequisites and guidance - Ensure installer falls back to pip when Poetry is not functional This fixes the issue where Poetry command exists but fails due to pyenv not finding it in the current Python version. 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
1 parent 3913873 commit dc70272

File tree

2 files changed

+23
-11
lines changed

2 files changed

+23
-11
lines changed

README.md

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -21,9 +21,9 @@
2121

2222
**One command. Instant AI coordination.**
2323

24-
**Prerequisites for all options:** Git, Python 3.9+, curl (for one-liner), and tar. Run from the root of an existing Git repository.
24+
**Prerequisites for all options:** Git, Python 3.9+, curl (for one-liner), and tar. Run from the root of an existing Git repository. **If using pyenv, ensure your active Python version (e.g., via `pyenv shell 3.12.x`) has Poetry installed if you prefer it; otherwise, the script falls back to pip.**
2525

26-
### Option 1: Universal One-Liner (Recommended - No Cloning Required)
26+
### **Option 1: Universal One-Liner (Recommended - No Cloning Required)**
2727
Run this in your existing project's root directory to download and install Conductor-Score directly:
2828

2929
```bash
@@ -33,8 +33,9 @@ bash <(curl -fsSL https://raw.githubusercontent.com/ryanmac/conductor-score/main
3333
- This method avoids cloning the full Conductor-Score repo and is ideal for integrating into existing projects without repository pollution.
3434
- The script will prompt before overwriting any existing installation.
3535
- **Security best practice:** Review the script at the raw URL before running.
36+
- **Pyenv users:** If Poetry install fails, switch to the Python version that has Poetry installed (e.g., `pyenv shell 3.10.13`) and re-run.
3637

37-
### Option 2: Poetry (Manual Clone)
38+
### Option 2: Poetry (For Cloned Repo)
3839
```bash
3940
# Clone the repository
4041
git clone https://github.com/ryanmac/conductor-score.git
@@ -45,7 +46,7 @@ poetry install
4546
poetry run python setup.py
4647
```
4748

48-
### Option 3: Pip + Virtual Environment
49+
### Option 3: Pip + Virtual Environment (For Cloned Repo)
4950
```bash
5051
# Clone the repository
5152
git clone https://github.com/ryanmac/conductor-score.git
@@ -62,7 +63,7 @@ pip install -r requirements.txt
6263
python setup.py
6364
```
6465

65-
### Option 4: One-Command Install Script (from cloned repo)
66+
### Option 4: One-Command Install Script (For Cloned Repo)
6667
```bash
6768
# From the repository directory:
6869
./install.sh

conductor-init.sh

Lines changed: 17 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,11 @@ if ! command -v tar >/dev/null 2>&1; then
5151
exit 1
5252
fi
5353

54+
# **Improved: Check for pyenv and suggest version switch if Poetry fails later**
55+
if command -v pyenv >/dev/null 2>&1; then
56+
echo -e "${YELLOW}⚠️ pyenv detected. Ensure your active Python version has Poetry installed if using it.${NC}"
57+
fi
58+
5459
# Check for existing installation
5560
if [ -d ".conductor" ]; then
5661
echo -e "${YELLOW}⚠️ Existing .conductor directory found.${NC}"
@@ -127,15 +132,21 @@ echo ""
127132
# Step 3: Install Dependencies
128133
echo -e "${YELLOW}📦 Installing dependencies...${NC}"
129134

130-
# Prefer Poetry if available, otherwise use pip + venv
131-
if command -v poetry >/dev/null 2>&1; then
132-
echo "🎵 Poetry detected. Using Poetry for installation."
135+
# **Improved: Check if Poetry is functional before using it**
136+
POETRY_AVAILABLE=false
137+
if command -v poetry >/dev/null 2>&1 && poetry --version >/dev/null 2>&1; then
138+
POETRY_AVAILABLE=true
139+
fi
140+
141+
# Prefer Poetry if available and functional, otherwise use pip + venv
142+
if $POETRY_AVAILABLE; then
143+
echo "🎵 Poetry detected and functional. Using Poetry for installation."
133144
poetry install || {
134-
echo -e "${RED}❌ Poetry install failed.${NC}"
145+
echo -e "${RED}❌ Poetry install failed. If using pyenv, try switching versions (e.g., pyenv shell 3.10.13) and re-run.${NC}"
135146
exit 1
136147
}
137148
else
138-
echo "📦 Poetry not found. Using pip and virtual environment."
149+
echo "📦 Poetry not found or not functional. Using pip and virtual environment."
139150
python3 -m venv .venv || {
140151
echo -e "${RED}❌ Failed to create virtual environment.${NC}"
141152
exit 1
@@ -158,7 +169,7 @@ echo ""
158169
echo -e "${YELLOW}🔧 Running automatic setup...${NC}"
159170

160171
# Run setup.py with --auto flag
161-
if command -v poetry >/dev/null 2>&1; then
172+
if $POETRY_AVAILABLE; then
162173
poetry run python setup.py --auto || {
163174
echo -e "${RED}❌ Setup failed.${NC}"
164175
exit 1

0 commit comments

Comments
 (0)