Skip to content

Setting Up a Python Environment

Andrew Boring edited this page Mar 4, 2019 · 7 revisions

In order to run the code in this repo, you'll need the Python language interpreter and add-on modules.

The high-level steps are:

  1. Install Python3.
  2. Configure a virtualenv and activate it.
  3. Install libraries/modules.
  4. Do stuff!

The specific steps will vary if you're running macOS, Windows, or a Linux/Unix-based OS.

Much of the code we provide here uses Jupyter notebook, pandas/numpy, requests library, and more. There are Cisco-provided Python libraries for interacting with the ACI infrastructure, but some require an older version of Python (2.7). Other libraries may work with Python 3.x, but only provide access to subset of features on the APIC controller. Some of the sample code here may use the Cisco libraries, but we also provide a lot of sample code to illustrate how to access objects and classes directly when the Cisco library is not available.

The Anaconda distribution is an easy way to get started with Python 3, as it includes a number of data analytics and visualization libraries, which will be convenient when generating reports from ACI.

Active State provides a Python distribution for Windows, macOS, and Linux.

macOS users can use Homebrew to install Python3, if preferred.

And of course, you can always download Python directly from the source, as well.