A simple, efficient tool for creating Python virtual environments with automatic requirements detection and installation.
- Automatic Python Detection: Finds the latest stable Python version on your system
- Smart Requirements Installation: Detects and installs from
requirements.txt
orrequirements.pip
- Cross-Platform Support: Works on Windows, macOS, and Linux
- Global Installation: Easy symlink creation for system-wide access
- Force Recreation: Option to recreate existing environments
- Comprehensive Logging: Timestamped output for better debugging
# Clone and make executable
git clone https://github.com/GriffinCanCode/QVenv.git
cd QVenv
chmod +x qvenv.py
# Create global symlink (optional)
python3 qvenv.py --install
# Copy to a directory in your PATH
cp qvenv.py /usr/local/bin/qvenv
chmod +x /usr/local/bin/qvenv
# Create virtual environment in ./venv
qvenv
# Create virtual environment in custom path
qvenv my_project_env
# Force recreate existing environment
qvenv -f venv
# Create environment and install requirements
qvenv --complete my_env
Option | Description |
---|---|
path |
Path for the virtual environment (default: ./venv ) |
-f, --force |
Force recreation if environment already exists |
--install |
Create symlink in PATH for global access |
--complete |
Auto-detect and install requirements after creation |
# Standard workflow
qvenv project_env
source project_env/bin/activate # Unix/macOS
# or
project_env\Scripts\activate # Windows
# Complete setup with requirements
qvenv --complete --force production_env
# Global installation
qvenv --install
QVenv automatically searches for and installs from:
requirements.txt
requirements.pip
The tool will find the first available requirements file and install all packages in the newly created virtual environment.
- Uses
python3
command by default - Activation:
source venv/bin/activate
- Symlink location:
~/.local/bin/qvenv
or/usr/local/bin/qvenv
- Falls back to
python
ifpython3
unavailable - Activation:
venv\Scripts\activate
- Manual PATH addition required
- Python 3.6 or higher
venv
module (usually included with Python)- Write permissions for target directory
"Python venv module not available"
# Install venv module
pip install venv
# or on some systems
python3 -m pip install --user virtualenv
"Permission denied" on symlink creation
# Run with appropriate permissions
sudo python3 qvenv.py --install
# or manually copy to PATH directory
Virtual environment not activating
- Ensure you're using the correct activation command for your platform
- Check that the virtual environment was created successfully
- Verify Python installation and PATH configuration
- Fork the repository
- Create a 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.
Part of the GSuite collection of development tools.