Complete Guide for Python venv setup
System details
Omarchy 3.3.3, Linux 6.18.3, Hyprland 0.53.1, Alacritty 0.16.1
What's wrong?
Python Virtual Environment Setup for Omarchy
Closes/Related to #3156
Omarchy's Starship prompt overrides Python's default venv indicator, and the activation script returns exit code 1 (showing ✗ instead of ❯).
this really bothered me as a python dev so i configured my own setup and decided to share it here.
Quick Setup
1. Add Python module to Starship
Edit ~/.config/starship.toml:
# Add $python to your format line:
format = "[$directory$git_branch$git_status$python]($style)$character"
# Add at end of file:
[python]
symbol = "🐍 "
pyenv_version_name = true
format = 'via [${symbol}${pyenv_prefix}(${version} )(\($virtualenv\) )]($style)'
style = "bold yellow"
pyenv_prefix = "pyenv "
python_binary = ["python3", "python", "python2"]
detect_extensions = ["py"]
detect_files = [".python-version", "Pipfile", "pyproject.toml", "requirements.txt", "setup.py", "tox.ini"]
detect_folders = []
disabled = false
2. Add helpers to ~/.bashrc
# Create venv with fixed exit code
mkv() {
python -m venv .venv && \
echo -e "\nreturn 0" >> .venv/bin/activate && \
echo "✓ Created .venv"
}
# Smart activation (prevents double-activation)
alias va='[ -z "$VIRTUAL_ENV" ] && source .venv/bin/activate || echo "Already active: $VIRTUAL_ENV"'
3. Reload shell
source ~/.bashrc
Usage
mkv # Create venv
va # Activate
deactivate # Deactivate
Result
# Before
[folder-name] main ✗ # No indicator, wrong symbol
# After
[folder-name] main (.venv) ❯ # Clear indicator, correct symbol
Demo
How exactly is this a bug that needs fixing? A post in the discussions tab would be more useful
Lifesaver! Thank you for sharing this. I agree that it'd be nice if Omarchy implemented something like this, or stopped using Starship or something. Starship's default behavior of obscuring the venv is very different from what Python developers would expect.
This is great but @sean-imus is right, this should probably be moved over to the discussions tab so as to not drown out people that might actually need help with something