Technical requirements
At the time of writing, we are using the following:
- R 4.2.1
- The RStudio 2023.03.1+446 “Cherry Blossom” release for Windows
For this chapter, you will need to install the following packages:
readxl
openxlsx
xlsx
To run the Python code in this chapter, we will be using the following:
- Python 3.11
pandas
openpyxl
- The
iris.xlsx
Excel file available in this book’s GitHub repository
While setting up a Python environment is outside the scope of this book, this is easy to do. The necessary packages can be installed by running the following commands:
python -m pip install pandas==2.0.1 python -m pip install openpyxl==3.1.2
Note that these commands have to be run from a terminal and not from within a Python script. They need to be run in the folder where requirements.txt
resides or a full path to the requirements.txt
file has to be included.
This book’s GitHub repository also contains a requirements.txt
file that you can use to install all dependencies. You can do this by running the following command:
python -m pip install -r requirements.txt
This command installs all the packages that will be used in this chapter so that you don’t have to install them one by one. It also guarantees that the whole dependency tree (including the dependencies of the dependencies) will be the same as what this book’s authors have used.
Alternatively, when using Jupyter Notebooks, you can use the following magic commands:
%pip install pandas==2.0.1 %pip install openpyxl==3.1.2
There is a GitHub account for all of the code examples in this book located at this link: https://github.com/PacktPublishing/Extending-Excel-with-Python-and-R. Each chapter has it’s own folder, with the current one as Chapter01
.
Note
Technical requirements for Python throughout the book are conveniently compiled in the requirements.txt
file, accessible on GitHub repository here, https://github.com/PacktPublishing/Extending-Excel-with-Python-and-R/blob/main/requirements.txt. Installing these dependencies will streamline your coding experience and ensure smooth progression through the book. Be sure to install them all before diving into the exercises.