Appendix A

 

A.1 Appendix: Setting up LangChain

In this appendix you’ll learn to set up LangChain for your machine. We cover the approaches both for Mac and for Windows.

A.1.1 Setting Up LangChain on Mac

First, ensure you have the Xcode command-line tools installed on your Mac. The developer tools help you run command-line operations in the Terminal on a Mac. To ensure that you have the latest developer tools installed run the following command.

xcode-select –install

This command will show a pop-up asking you to install the developer tools. We also need a package manager to ensure you can easily install, update, and manage various libraries that we will need to start programming with LangChain. The most common and widely used package manager is Homebrew. It is a package manager for MacOS and Linux, enabling users to manage (install, update, uninstall) various libraries, applications, and tools. We will use HomeBrew throughout this book. You can find more details on installation, etc. here: https://brew.sh/

Python is the most commonly and widely used programming language in AI and ML. This book will use Python for all our examples and experiments. Before that, we will install the latest version of Python using the following command.

brew install python

A.1.2 Setting up LangChain in Windows