A lightweight, high-performance Python virtual environment manager built in C++
- Blazing Fast - Written in C++ for instant startup and minimal memory usage
- Zero Dependencies - Built with only standard C++ libraries (no external dependencies)
- Cross-Platform - Works on Linux, macOS, and Windows
- Beautiful Output - Colorized terminal output for better readability
- User-Friendly - Simple, intuitive commands
- Secure - No Python runtime vulnerabilities, smaller attack surface
# Clone or download the source
cd pyp-cpp
# Make install script executable
chmod +x install.sh
# Run installation
./install.sh
# Restart your shell or source your config
source ~/.bashrc # or ~/.zshrc
# Verify installation
pyp --help# Create a virtual environment
pyp -b myenv
# Create with specific Python version
pyp -b myenv --python 3.11
# Create with system site-packages
pyp -b myenv --system-site-packages
# Create and upgrade pip/setuptools
pyp -b myenv --upgrade
# Activate environment
pyp -a myenv
# List all environments
pyp -l
# Show environment info
pyp -i myenv
# Set default environment
pyp --set-default myenv
# Deactivate (run in shell)
deactivate
# Remove environment
pyp --remove myenv| Command | Description |
|---|---|
pyp -b <name> |
Create a new virtual environment |
pyp -a <name> |
Activate a virtual environment |
pyp -d |
Deactivate current environment |
pyp -l |
List all environments |
pyp -i <name> |
Show environment information |
pyp --set-default <name> |
Set default environment |
pyp --remove <name> |
Remove an environment |
pyp --help |
Show help message |
pyp --version |
Show version information |
| Option | Description |
|---|---|
--python VERSION |
Python version (e.g., 3.11) |
--system-site-packages |
Include system site-packages |
--upgrade |
Upgrade pip and setuptools after creation |
./install.sh- Installs to
~/.local/bin - Automatically configures PATH
- Creates backup of existing configuration
./install.sh --install-dir /usr/local/bin./install.sh --no-path./install.sh --force./uninstall.sh./uninstall.sh --keep-config./uninstall.sh --force- Compiler: g++ or clang++
- Standard: C++17 (for
<filesystem>support) - Flags:
-std=c++17 -O2 -Wall -Wextra
#include <iostream> // Input/output streams
#include <fstream> // File operations
#include <sstream> // String streams
#include <string> // String manipulation
#include <vector> // Dynamic arrays
#include <map> // Key-value pairs
#include <filesystem> // File system operations (C++17)
#include <cstdlib> // System calls
#include <chrono> // Time operations| Metric | Python Version | C++ Version |
|---|---|---|
| Startup Time | ~50-100ms | ~1-5ms |
| Memory Usage | ~10-20MB | ~1-5MB |
| Dependencies | Python 3.6+ | None |
pyp-cpp/
βββ main.cpp # Main C++ source code
βββ install.sh # Installation script
βββ uninstall.sh # Uninstallation script
βββ test.sh # Test script
βββ README.md # This file
βββ LICENSE # MIT License
- Default install directory:
~/.local/bin - Requires
g++orclang++ - Supports bash and zsh
- Requires Xcode command line tools
- Supports zsh (default shell on macOS 10.15+)
- Uses BSD sed instead of GNU sed
- Uses WSL or MinGW for compilation
- Supports PowerShell and CMD
- Binary:
pyp.exe
Location: ~/.pyp_config.json
{
"myenv": {
"path": "/home/user/projects/myenv",
"python": "/usr/bin/python3",
"created": "2024-01-01 12:00:00"
},
"default": {
"path": "/home/user/projects/myenv",
"python": "/usr/bin/python3"
}
}- Fork the repository
- Create your feature branch (
git checkout -b feature/amazing-feature) - Commit your changes (
git commit -m 'Add amazing feature') - Push to the branch (
git push origin feature/amazing-feature) - Open a Pull Request
This project is licensed under the MIT License - see the LICENSE file for details.
- Inspired by mosi-sol/idea-factory/pyp-Secure_python_venv - same creator
- Python Software Foundation for the venv module
- C++ community for the excellent standard library
LotusOS-Core , 2025-2026