[Day#1b PyATS Series] Step-by-Step: Install pyATS in PyCharm (Ubuntu)

If you’re exploring Python for Network Engineers, mastering tools like pyATS is a game-changer for automating network testing and validation. This guide walks you through setting up pyATS in PyCharm on Ubuntu, step by step, so you can build robust network automation workflows with confidence. Whether you’re a beginner in network automation or a seasoned engineer transitioning to Python, this tutorial will help you streamline device testing, configuration validation, and multi-vendor network operations using Cisco’s pyATS framework.


Prerequisites

  1. Python 3.8–3.11 installed (check with python3 --version)
  2. PyCharm installed
  3. pip and venv installed:
sudo apt update
sudo apt install python3-pip python3-venv

Step 1: Create a Virtual Environment

  1. Open a terminal.
  2. Create a venv for your PyCharm project:
sudo su
mkdir ~/pyats_project
cd ~/pyats_project

apt install python3.10-venv
python3 -m venv venv
  1. Activate it:
source venv/bin/activate
  1. Upgrade pip:
pip install --upgrade pip

Step 2: Install pyATS (full version)

Install pyATS and Genie:

pip install pyats[full]

Verify:

pyats version check

Expected output:

pyATS 23.x
Genie 23.x

Step 3: Set Interpreter in PyCharm

  1. Open PyCharm → File → New Project → Python
  2. Select:
    “Existing Interpreter”
    Point to:
    ~/pyats_project/venv/bin/python
    or
    ~/pyats_project/
  3. Click Create from Existing Sources > New Window

Alternatively, on your Pycharm (Ubuntu) > File > Settings > Project Interpreter > Click “+” > Install “pyATS” as shown below:


Step 4: Create pyATS Test Files

testbed.yml

testbed:
name: my_testbed
devices:
Router1:
os: iosxe
type: router
connections:
defaults:
class: unicon.Unicon
cli:
protocol: ssh
ip: 192.168.1.1
credentials:
default:
username: admin
password: cisco

ping_test.py

from pyats.topology import loader

# Load testbed
testbed = loader.load('testbed.yml')

# Connect to device
device = testbed.devices['Router1']
device.connect()

# Ping test
result = device.ping('8.8.8.8')
print("Ping result:", result)

device.disconnect()

Step 5: Run the Script

  • Right-click ping_test.py → Run
  • Or open PyCharm terminal and activate venv:
source venv/bin/activate
python ping_test.py

Bonus: Run pyATS CLI

In PyCharm terminal:

pyats learn interface --testbed-file testbed.yml
Dhawan Sagar

Hi all,
Good to see you here.
I'm your Trainer for CCIE, CCNP, CCNA, Firewall batches and many more courses coming up!
Stay tuned for latest updates!
Keep me posted over Whatsapp/Email about your experience learning from us.
Thanks for being part of - "Network Journey - A journey towards packet-life!!!"