virtualenv

21.2.0 · active · verified Sat Mar 28

virtualenv is a tool for creating isolated Python environments, allowing developers to manage dependencies for different projects separately. The current version is 21.2.0, with regular updates to enhance functionality and maintain compatibility with Python versions.

Warnings

Install

Quickstart

This script demonstrates how to create, activate, use, and deactivate a virtual environment using virtualenv.

import os

# Create a virtual environment
os.system('virtualenv myenv')

# Activate the virtual environment
if os.name == 'nt':
    os.system('.\\myenv\\Scripts\\activate')
else:
    os.system('source myenv/bin/activate')

# Install a package within the virtual environment
os.system('pip install requests')

# Deactivate the virtual environment
os.system('deactivate')

view raw JSON →