A PyQt6-based desktop application for discovering, managing, and interacting with Python virtual environments and Conda environments on your system.
- Automatic Environment Detection: Scans directories to find:
- Standard Python virtual environments (
venv,virtualenv) - Conda environments
- Standard Python virtual environments (
- Tree View Display: Visualizes discovered environments in a hierarchical structure
- Context Menu Actions:
- Open terminal in the virtual environment folder
- Open terminal in the parent folder with environment activated
- Run Python scripts found inside or outside the environment
- Cross-Platform Support: Works on Windows, macOS, and Linux
- Dark Mode UI: Modern dark theme stylesheet for comfortable viewing
- Python 3.8+
- PyQt6
- Clone or download this repository
- Install dependencies:
pip install PyQt6
Run the application:
python venv_manager.py- Select Directory: Use the "Browse..." button or manually enter a root directory path to scan
- Scan: Click "Scan" to search for virtual environments within the selected directory
- Interact: Right-click on any detected environment to:
- Open a terminal with the environment activated
- Run Python scripts found in or near the environment
- Uses
cmd.exefor terminal operations - Supports both
.batactivation scripts for standard venvs andconda activatefor Conda environments
- Uses AppleScript to control the Terminal app
- Requires Terminal app to be installed (default on macOS)
- Automatically detects and uses available terminal emulators in this priority order:
- gnome-terminal
- konsole
- xfce4-terminal
- x-terminal-emulator
- xterm
- alacritty
- kitty
.
├── venv_manager.py # Main application file
└── README.md # This file
-
Scanning: The
VenvSearchWorkerthread walks through the directory tree looking for:conda-metafolders (Conda environments)bin/activateorScripts/activatefiles (Python venvs)
-
Tree Building: Discovered paths are organized into a tree structure showing the hierarchy relative to the scanned root directory
-
Script Discovery: When right-clicking an environment, the app searches for:
- Python files inside the venv (excluding dependency folders like
lib,bin, etc.) - Python files in the parent directory (outside the venv)
- Python files inside the venv (excluding dependency folders like
-
Terminal Launch: Based on the OS, the app constructs appropriate commands to:
- Change to the working directory
- Activate the environment
- Optionally run a selected Python script
The application includes a comprehensive dark mode stylesheet. You can modify the QApplication.setStyleSheet() call in the __main__ block to customize colors and styling.
This project is provided as-is for educational and practical use.