Appendix A. Conda Environments
In Chapter 2, I introduced Conda environments by explaining that (base) at the beginning of an Anaconda Prompt stands for the currently active Conda environment with the name base. Anaconda requires you to always work in an activated environment, but the activation is done automatically for the base environment when you start the Anaconda Prompt on Windows or the Terminal on macOS. Working with Conda environments allows you to properly separate the dependencies of your projects: if you want to try out a newer version of a package like pandas without changing your base environment, you can do so in a separate Conda environment. In the first part of this appendix, I will walk you through the process of creating a Conda environment called xl38 where we will install all packages in the version I used them to write this book. This will allow you to run the samples in this book as-is, even if some packages have released new versions with breaking changes in the meantime. In the second part, I will show you how to disable the auto activation of the base environment if you don’t like the default behavior.
Create a New Conda Environment
Run the following command on your Anaconda Prompt to create a new environment with the name xl38 that uses Python 3.8:
(base)> conda create --name xl38 python=3.8
When hitting Enter, Conda will print what it is going to install into the new environment and asks you to confirm:
Proceed ([y]/n)?
Hit Enter to confirm or type ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access