12
When I try to activate my virtual environment with "source venv/bin/activate", nothing happens. No error, but the prompt doesn't change.
Loading...
Q&A · Answered
When I try to activate my virtual environment with "source venv/bin/activate", nothing happens. No error, but the prompt doesn't change.
Accepted answer
This can happen for several reasons. Here are the fixes:
# List venv contents
ls -la venv/bin/
# You should see activate, python, pip files
# Remove old venv
rm -rf venv
# Create new one
python3 -m venv venv
# Activate
source venv/bin/activate
# For bash
source venv/bin/activate
# For zsh
source venv/bin/activate
# For fish shell
source venv/bin/activate.fishSay what you tried, not only what worked — the next person needs the reasoning. Code goes in a fenced block.