This guide explains how to create and activate a Python virtual environment using venv for Python versions 3.10 to 3.14.
A virtual environment is an isolated Python environment that allows you to install packages for a specific project without affecting your system's global Python installation. This helps avoid package conflicts between different projects.
- Python 3.10, 3.11, 3.12, 3.13, or 3.14 installed on your system
- Basic knowledge of command line operations
- Open a terminal window
- Navigate to your project directory:
cd the-root-of-this-project - Create a virtual environment:
python3 -m venv venv
- Open Command Prompt or PowerShell
- Navigate to your project directory:
cd the-root-of-this-project - Create a virtual environment:
python -m venv venv
source venv/bin/activatevenv\Scripts\activate.bat
venv\Scripts\Activate.ps1
Once activated, you'll notice your command prompt changes to show the name of the activated environment. For example:
(venv) $
When you're done working in the virtual environment, you can deactivate it by running:
deactivateTo verify the Python version in your virtual environment:
python --versionMake sure it shows a version of at least 3.10.
After activating your virtual environment, you can install packages from pypi:
pip install microsoft-agents-activity
pip install microsoft-agents-authorization
pip install microsoft-agents-connector
pip install microsoft-agents-client
pip install microsoft-agents-hosting-core
pip install microsoft-agents-authentication-msal
pip install microsoft-agents-copilotstudio-client
pip install microsoft-agents-hosting-core-aiohttp
pip install microsoft-agents-storage-core