CRITICAL: Fix virtual environment activation issues
Some checks are pending
CI/CD Pipeline / test (ubuntu-latest, 3.10) (push) Waiting to run
CI/CD Pipeline / test (ubuntu-latest, 3.11) (push) Waiting to run
CI/CD Pipeline / test (ubuntu-latest, 3.12) (push) Waiting to run
CI/CD Pipeline / test (windows-latest, 3.10) (push) Waiting to run
CI/CD Pipeline / test (windows-latest, 3.11) (push) Waiting to run
CI/CD Pipeline / test (windows-latest, 3.12) (push) Waiting to run
CI/CD Pipeline / security-scan (push) Waiting to run
CI/CD Pipeline / auto-update-check (push) Waiting to run

- Use direct .venv/bin/python paths to bypass activation problems
- Install packages using full path method (bypasses system restrictions)
- Activate environment only after installation for command usage
- Handles systems where source .venv/bin/activate fails to override system Python

Fixes virtual environment detection issues in restricted environments.
This commit is contained in:
FSSCoding 2025-09-06 17:26:17 +10:00
parent 919f7284a9
commit cec88ead1a

View File

@ -87,23 +87,24 @@ cd Fss-Mini-Rag
# Install dependencies and package # Install dependencies and package
python3 -m venv .venv python3 -m venv .venv
# CRITICAL: Use full path activation for reliability
.venv/bin/python -m pip install -r requirements.txt
.venv/bin/python -m pip install .
# Activate environment for using the command
source .venv/bin/activate # Linux/macOS source .venv/bin/activate # Linux/macOS
# .venv\Scripts\activate # Windows # .venv\Scripts\activate # Windows
# Use python -m pip for reliability (handles externally-managed-environment errors)
python -m pip install -r requirements.txt
python -m pip install .
``` ```
**If you get "externally-managed-environment" error:** **If you get "externally-managed-environment" error:**
```bash ```bash
# Verify virtual environment is active # Use direct path method (bypasses system restrictions entirely)
which python # Should show .venv/bin/python .venv/bin/python -m pip install -r requirements.txt --break-system-packages
python -m pip --version # Should show .venv path .venv/bin/python -m pip install . --break-system-packages
# If still failing, use override (safe in virtual environment) # Then activate for using the command
python -m pip install -r requirements.txt --break-system-packages source .venv/bin/activate
python -m pip install . --break-system-packages
``` ```
**Step 2: Start Using** **Step 2: Start Using**