anthropics / anthropics/claude-quickstarts
Inconsistent Virtual Environment Activation Path for Windows in `setup.sh` Script
- Dominant language
- TypeScript
- Stars
- 17.6k
- Forks
- 3k
- Avg merge
- 5h 13m
- Merged PRs (30d)
- 3
Description
#### **Description:**
The current `setup.sh` script uses the default activation path `.venv/bin/activate` for virtual environments, which works on Linux and macOS systems. However, on Windows, the correct path for activating the virtual environment is `.venv/Scripts/activate`. This discrepancy causes the script to fail when trying to activate the virtual environment on Windows machines.
#### **Steps to Reproduce:**
1. Clone the repository and navigate to the project directory on a Windows machine.
2. Run `./setup.sh`.
3. The script will attempt to activate the virtual environment using `.venv/bin/activate`, resulting in an error:
```bash
./setup.sh: line 18: .venv/bin/activate: No such file or directory
```
#### **Expected Behavior:**
The virtual environment should be activated using the correct path on both Windows (`.venv/Scripts/activate`) and Linux/macOS (`.venv/bin/activate`).
#### **Proposed Solution:**
Add an OS check within the `setup.sh` script to determine the appropriate activation path based on the user's operating system:
```bash
if [[ "$OSTYPE" == "msys" || "$OSTYPE" == "win32" ]]; then
source .venv/Scripts/activate # Windows activation path
else
source .venv/bin/activate # Linux/macOS activation path
fi
Contributor guide
No contributing guide indexed for this repository
Assessment
This issue has not been assessed yet.