Below is a beginner-friendly guide to setting up VisionAgent using Python’s built-in virtual environment tool, venv
. We’ll walk you through installing Python (if needed), creating and activating a virtual environment, installing VisionAgent, and setting environment variables for your API keys.
Why virtual environments with venv?
venv
is a built-in tool (since Python 3.3) that allows you to isolate project dependencies. This prevents conflicts between different Python projects on your system, much like conda but without the extra overhead of the conda environment manager.
Mac or Linux:
Open a Terminal and type:
python3 --version
Windows:
Open Command Prompt or PowerShell and type:
python --version
Python 3.10.x
, you’re good to go.Make sure to check the box to add Python to your PATH during installation on Windows, or you might have to manually update your PATH.
Open a Terminal (Mac/Linux) or Command Prompt/PowerShell (Windows).
Navigate to a folder where you’d like to keep your project (optional step), for example:
cd ~/projects # Mac/Linux
cd %USERPROFILE%\\projects # Windows
Create a new folder for your VisionAgent project (optional, but keeps things organized):
mkdir visionagent-project
cd visionagent-project
Create a virtual environment named va
(short for “VisionAgent”):
Mac/Linux:
python3 -m venv va
Windows:
python -m venv va
Activate the environment:
Mac/Linux:
source va/bin/activate
(Your prompt will usually change to (va)
.)
Windows (CMD):
va\\Scripts\\activate
Windows (PowerShell):
.\\va\\Scripts\\activate
(Your prompt will usually change to (va)
.)
va
environment is activated (you should see (va)
or similar in your prompt).