For this section we are going to work in a different virtual environment than the one Ansible setup we previously created. This is very common practice amongst Python users. You might have a virtual environment that you setup specifically with one Ansible version, one Python version that you know works. You can then reference this base software version combination going forward, giving you confidence that you can use a base code of software going forward without having to update/fix.
To avoid confusion please close all the open file tabs you have open in the editor
For this portion of the lab you are going to create a different Python virtual environment that is separate from the work that was done for Ansible.
pyenv virtualenv 3.10.13 requests
cd ~/ltrdcn-3225/requests
Setup local pyenv as we did before.
pyenv local requests
With the environment active, any Python packages are now install in the virtual environment directory that was specified in ~/envs and don't affect the system or any other application. This is very important as you could be developing various applications and you don't want to break another application by upgrading a requirement unnecesarily.
You have to do this for every virtual environment that you build as the software and libraries in each is unique to that environment.
pip install --upgrade pip
pip install wheel
The request library makes it possible to easily have Python make requests to a REST interface.
pip install requests
Ptable will help us with showing structured data from the ACI fabric in a way that is easier to read for humans.
pip install ptable
Pprint will also help us with showing structured data from the ACI fabric in a way that is easier to read for humans.
pip install pprintpp rich
You will be using the jinja library to build data objects via templates.
pip install jinja2