In this lesson, we will cover:

  • How to download the code repo that accompanies this course.
  • How to install the requirements and set up your environment ready to get hands-on.


In addition to the course content, this course also provides a code repo and access to a multi-vendor lab.

Below are the steps required to access both:

Code Repo Download

To download the associated code repo for this course, perform the following:

$ git clone [email protected]:packetcoders/pyats-course.git
$ cd pyats-course

Install Environment Dependencies

Create Virtual Environment

First we will create a virtual environment into which we will install our requirements.

# Create a new venv directory
mkdir ../venv

# Create a virtual environment
python3 -m venv ../venv/venv-pyats

# Activate the virtual environment
source ../venv/venv-pyats/bin/activate

Install Dependencies

pip install -r requirements.txt

Setup Credentials

Next, add your credentials for the lab into a file named .env. You can create a copy of the file from .env.example as follows:

$ cp .env.example .env
$ cat .env

The credentials for populating the .env file can be found within the lab guide here:

The environment variables from .env will now be automatically imported when you run the examples in the course that need access to the lab devices or services.
This .env import is performed using python-dotenv, and the following code:

from dotenv import load_dotenv

# Load environment variables from .env
Ready to Master Network Automation? Start Your Journey Today!
Our membership provides:
  • 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
  • Live monthly tech sessions
  • Access to tech session library

Join Now ➜
Close You've successfully subscribed to Packet Coders.
Close Success! Your account is fully activated, you now have access to all content.
Close Welcome back! You've successfully signed in.
Close Nearly there! To activate your account, please click the link in the email we just sent you.