Great idea! Using a virtual environment (venv) is the best practice to isolate dependencies. Here's the step-by-step process for Windows:


1. Create a Virtual Environment

Open PowerShell in your project folder and run:

# Create a virtual environment named 'tf_env' (or any name you prefer)
python -m venv tf_env


2. Activate the Virtual Environment

# Activate the environment
.\\\\tf_env\\\\Scripts\\\\Activate.ps1

Your prompt will change to (tf_env) PS ... indicating the environment is active.


3. Install TensorFlow 2.15.0 and TensorFlow Addons

Run these commands inside the activated environment:

# Upgrade pip (optional but recommended)
python -m pip install --upgrade pip

# Install TensorFlow 2.15.0
pip install tensorflow==2.15.0

# Install compatible TensorFlow Addons
pip install tensorflow-addons==0.21.0


4. Verify Installations

Check the installed versions:

python -c "import tensorflow as tf; print('TensorFlow:', tf.__version__)"
python -c "import tensorflow_addons as tfa; print('TFA:', tfa.__version__)"

You should see:

TensorFlow: 2.15.0
TFA: 0.21.0