You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
uv venv # Create .venv in current directory
uv venv myenv # Create named environment
uv venv --python 3.11 # Specify Python version
List Virtual Environments
ls -la # Show .venv in current directory
find ~ -name ".venv" -type d 2>/dev/null # Find all .venv directories
uv venv list # List UV managed environments (if available)
Find Virtual Environment Location
echo$VIRTUAL_ENV# Show active venv path
which python # Show active Python executable path
python -c "import sys; print(sys.prefix)"# Show Python environment prefixpwd# Current directory (where .venv usually is)
Check Virtual Environment Status
echo$VIRTUAL_ENV# Shows path if venv is active
ps1 # Check if prompt shows venv name
python --version # Check Python version in current env
Activate Virtual Environment
source .venv/bin/activate
Deactivate Virtual Environment
deactivate # Exit virtual environment
Create and Use Environment in One Step
uv run python script.py # Auto-creates venv if needed
Package Management
Install Packages
uv add requests # Add package to project
uv add "django>=4.0"# Add with version constraint
uv add --dev pytest # Add as development dependency
uv add --optional test pytest # Add to optional group
# If UV not found after installationsource~/.bashrc # or ~/.zshrc# Check if venv is activatedecho$VIRTUAL_ENV# Reinstall UV
curl -LsSf https://astral.sh/uv/install.sh | sh
# Reset project environment
rm -rf .venv uv.lock
uv sync
Debug Commands
uv --verbose run python script.py # Verbose output
uv doctor # System diagnostics (if available)