Appendix A. Setting up your development environment
To successfully build the financial AI systems described in this book—ranging from credit scoring pipelines to autonomous retention agents—you need a stable and reproducible development environment. Financial machine learning and generative AI rely on a complex web of dependencies. Installing these libraries globally on your machine can lead to version conflicts with other projects.
This appendix walks you through setting up an isolated virtual environment, installing the exact library versions used to develop the code in this book, and securely managing your API keys.
A.1 Prerequisites
The code in this book was developed and tested using Python 3.12. We strongly recommend using Python 3.12.3 (or a newer 3.12.x release) to ensure maximum compatibility with the provided dependencies.
If you do not have Python installed, download it from the official Python website (python.org) or use a package manager like Homebrew (macOS) or apt (Linux).
A.2 Creating a virtual environment
Creating a dedicated virtual environment ensures that the packages installed for this book do not interfere with your system Python or other projects. You can use either Python's built-in venv module or conda.
Using venv (Recommended for most users)
Open your terminal or command prompt, navigate to the directory where you plan to store the book's code, and run the following commands: