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.9.11 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 ~/envsand don't affect the system or any other applications. 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.
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