Select the directory option from the above "Directory" header!

Menu
Get started with Anaconda Python

Get started with Anaconda Python

Anaconda provides a handy GUI, a slew of work environments, and tools to simplify the process of using Python for data science.

Credit: David Clode

Conda environments, as they’re called, are functionally similar to venv-type virtual environments. If you want to use specific versions of packages, or specific versions of the Python interpreter as well, you can place them into a Conda environment and use them in isolation.

Venv environments can be moved around, but they don’t necessarily have detailed information about how they were created. This can be a problem if you need to have a reproducible environment for the work you’re doing. Conda environments try to address this problem, because they’re meant to be reproducible.

If you want other people to use your Conda environment, you provide them with a copy of the environments definition file, which describes how to re-create the environment on another system. There are limitations to how well this can work in a cross-platform fashion, so any differences between how packages work on different platforms (such as MacOS vs. Linux) will need to be ironed out manually.

anaconda navigator 03 IDG

Three Conda environments, each with its own set of packages and Python runtimes. The env-37 environment uses Python 3.7 instead of a more recent version. The no-sqlite environment omits the sqlite package (as shown in the package list at right). Each Conda environment must have its set of packages updated separately.

Anaconda Project

One common problem with data science, and software development in general, is reproducing the exact environment used for a particular job. Even Conda environments provide only a partial solution for this problem, because CPython venv-type environments don’t and can’t reproduce things like environment variables.

Enter Anaconda Project. It lets you take a directory full of things related to something you’re doing with Anaconda—“web apps, scripts, Jupyter notebooks, data files, whatever it may be,” as Anaconda puts it—and turn it into a reproducible resource. That directory, once it’s managed by Anaconda Project, can be run in a consistent way no matter where it’s run, as long as there’s a copy of Anaconda itself handy.

Anaconda Project’s biggest issue right now is that it’s still considered a beta-level product, so it isn’t stable yet. Until it is, it shouldn’t be used for sharing work in environments where you can’t guarantee that everyone will be running the same version. In the meantime, Conda environments can provide a dependable subset of the same functionality.

Applications in Anaconda

Another way Anaconda adds convenience to using Python for analysis and scientific work is how it bundles and makes accessible several common projects for working with data interactively.

Two of the most common such projects are Jupyter Notebook and JupyterLab, which provide live environments for writing Python code, importing data, running experiments, and visualising the results. Anaconda handles all the setup and management for running Notebook and JupyterLab instances, so working with them involves little more than clicking the Launch button next to each app in Navigator’s main menu. You can also install prior versions of each app by clicking the app’s gear icon, assuming they’re available.

Other bundled apps include:

  • Qtconsole: A GUI for Jupyter that uses the Qt interface library. It’s useful if you’d rather work with Jupyter notebooks through an interface that’s native to the platform you’re running on rather than through a web browser.
  • Spyder: The Scientific Python Development Environment, a mini-IDE written in Python geared mainly towards developers writing apps that work with IPython/Jupyter notebooks. It can also be used as a library for Python applications that need an IDE-like interface.
  • RStudio: Tools for working with the R language, used in many fields for data analysis. Python has grown in popularity with users of R, but there are still plenty of scenarios where R remains the language of choice, and RStudio provides ways to work with the two languages together.
  • Visual Studio Code: Microsoft’s editor can be as simple or as advanced as you want to make it, thanks to its enormous culture of extensions. It’s also one of the best environments for working with Python. Anaconda users can jump right into Visual Studio Code without having to install it separately.
anaconda notebook IDG

Anaconda bundles many auxiliary applications, such as Jupyter Notebook, an in-browser interactive work environment for Python. All the management details for Jupyter are automatically handled by Anaconda.

Miniconda, the lightweight Anaconda

If you want to use Anaconda, but don’t want to install everything at once, and don’t necessarily need the Navigator, you can take an incremental approach with Miniconda.

Miniconda installs only the absolute minimum you need to get started with Anaconda: the Python interpreter (as packaged by Anaconda), the Conda package manager, and a few other basic bits. You can add more components or create environments using Conda from the command line, much as you would for the full-blown version of Anaconda.

If you’re not a data-science user, but you want to take advantage of how Anaconda is designed and packaged, Miniconda is a good way to work with Python. Packages are generally easier to handle with Conda, and you have access to the broader ecosystem of Anaconda software if and when you need it.

A few things are worth keeping in mind. First, as hinted above, the Anaconda Navigator GUI isn’t installed by default. However, if you find that you want it, you can add it after the fact in Conda (conda install anaconda-navigator).

Second, Miniconda installs by default to a directory named Miniconda3, rather than Anaconda. This might throw off someone making assumptions about what path to use to find the Miniconda installation. The install directory can be customised as needed, though.

Third, and in some ways most important, Conda can be used only to install packages available through Conda’s own repository. It isn’t used to install packages available through the default Python package repository, PyPI. You can use the standard Python package management tool, Pip, to install Python packages from PyPI inside Miniconda—but those packages can’t be managed by Conda, only Pip, and you will need to take specific steps to allow Pip and Conda to coexist.

If you absolutely want Conda to manage everything, you can repackage PyPI packages as Conda packages via a two-step process.


Follow Us

Join the newsletter!

Or

Sign up to gain exclusive access to email subscriptions, event invitations, competitions, giveaways, and much more.

Membership is free, and your security and privacy remain protected. View our privacy policy before signing up.

Error: Please check your email address.
Show Comments