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.
Table of Contents
Prerequisites
- Python 3.8–3.11 installed (check with
python3 --version
) - PyCharm installed
pip
andvenv
installed:
sudo apt update
sudo apt install python3-pip python3-venv
Step 1: Create a Virtual Environment
- Open a terminal.
- Create a venv for your PyCharm project:
sudo sumkdir ~/pyats_project
cd ~/pyats_project
apt install python3.10-venv
python3 -m venv venv
- Activate it:
source venv/bin/activate
- 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
- Open PyCharm → File → New Project → Python
- Select:
“Existing Interpreter”
Point to:~/pyats_project/venv/bin/python
or~/pyats_project/
- 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