In this lesson, we will cover:

  • How to install pyATS.
  • The main requirements of pyATS.
  • How to validate your installation.
  • How to check for new pyATS versions and upgrade our installation.

The scripts and code for this lesson can be found within the pyATS repo under the directory: 001_installing/.

Requirements

First, let’s cover the requirements of pyATS. The main requirements you should be aware of are:

  • Python 3.5+ must be used.
  • Installation only supports a Linux based OS. If you are using Windows, you can use WSL2, which works great.

You can find the full requirements here.

Create Virtual Environment

Before installing pyATS, we will create a virtual environment in which we will install pyATS. By installing pyATS within a virtual environment, we can ensure it (and all of its dependencies) are isolated from any other Python packages installed on the system.

# Create a virtual environment
python3 -m venv venv

# Activate the virtual environment
source venv/bin/activate

Install pyATS

Now we are inside our newly created virtual environment; we can install pyATS like so:

pip3 install "pyats[full]==21.4"

It is worth mentioning that pyATS uses CalVer for its versioning.

CalVer is a versioning convention based on your project's release calendar instead of arbitrary numbers.

Therefore a version of 21.4 would relate to the 2021 April release. The release cycle of pyATS/Genie is typically 6-8 weeks.

Validate Installation

To validate that PyATS and Genie have been correctly installed, we can perform the following:

$ pip3 freeze | grep -E "pyats=|genie="  
genie==21.4
pyats==21.4

Version Check and Update

Once installed, you can check to see if any components of your pyATS installation are outdated. Like so:

$ pyats version check --outdated
...
Checking for outdated packages...

  Package                      Version Latest
  ---------------------------- ------- ------
  genie                        21.4          
  genie.libs.clean             21.4          
...

You can then choose to update your pyATS installation to the latest versions by running:

$ pyats version update
Checking your current environment...
Master Network Automation
Join today and get access to:
  • Full deep-dive course library (inc. Batfish, pyATS, Netmiko)
  • Code repositories inc. full course code, scripts and examples
  • 24x7 Multi-vendor labs (Arista, Cisco, Juniper)
  • Private online community
  • Monthly online meetups
  • Monthly guest speakers

100% Satisfaction Guaranteed!
Cancel your membership at any time.


Join Today