Conda

Last, but not least, let's talk about Conda. Yes, this is a tool, developed by Anaconda, hence the name. If you installed Python via Anaconda, you have it already. Conda represents two things at the same time – a package manager, and a virtual environment manager. Let's now discuss these two roles in more detail.

First, and foremost, Conda allows you to install Python packages (and other tools). Compared to Python's original pip package manager, it is language-agnostic, and can install any type of software; this feature is vital to the data science stack, as many tools are based on code, written in the C, C#, and Fortran languages—Conda just pulls a binary suitable for your operating system, if there is one.

In order to see all the packages already installed, type conda list in your terminal, and hit Enter – this will print out all the packages Conda installed, with the version specified. You can always install more—just type conda install my_package_name—this will take care of the rest, installing the package and all its dependencies from the internet. The packages available (most of them are) are grouped by channels. The default one, the Anaconda channel, represents Anaconda Inc.'s official repository of packages—all packages here are checked and guaranteed to install properly. The downside is the fact that only very popular packages are stored here, and new ones are added slowly. Among many others, representing different communities (such as Bioconda—a channel for biology-related packages), the most prominent is conda-forge, an open channel for any kind of package maintained by a group of volunteers. It is relatively easy to get your package on this channel, so here you can find most of them. The downside is that some packages could be abandoned, won't install properly, or – in theory – may even be malicious. It is a good idea to specify the channel you want to install from (many of them overlap) by using the -c flag:

conda install -c conda-forge tqdm

By default, it will try to install the most recent version of the package that is available for your system. You can, however, request a specific version explicitly, or even require a version to be above the specific one:

# specific version of the package
conda install -c conda-forge tqdm=4.31.1

# most recent package available, with version larger
# or equal to specified
# if conda can't get the version recent enough –
# it will not install it, and raise an Exception
conda install -c conda-forge tqdm>= 4.30

Now, let's discuss another use for Conda—as a virtual environment manager.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
3.149.252.238