Managing Python packages with conda

Apart from using Anaconda Navigator and Cloud for package management, you can use conda, a binary package manager, as a command-line tool to manage your package installations. conda quickly installs, runs, and updates packages and their dependencies. conda easily creates, saves, loads, and switches between environments on your local computer. The best ways to install conda are through installing either Anaconda or Miniconda. A third option is a separate installation through Python Package Index (PyPI), but may not be up-to-date so this option is not recommended.

Installing packages with conda is straightforward, as it resembles the syntax of pip. However, it is good to know that conda cannot install packages directly from a Git server. This means that the latest version of many packages under development cannot be downloaded with conda. Also, conda doesn't cover all the packages available on PyPI as pip does itself, which is why you always have access to pip when creating a new environment with Anaconda Navigator (more on pip as we proceed further).

You can verify if conda is installed by typing the following command in a terminal:

>> conda -version

If installed, conda will display the number of the version that you have installed. Installing the package of your choice can be done with the following command in a terminal:

>> conda install <package-name>

Updating an already installed package to its latest available version can be done as follows:

>> conda update <package-name>

You can also install a particular version of a package by pointing out the version number:

>> conda install <package-name>=1.2.0

You can update all the available packages simply by using the --all argument:

>> conda update --all

You can uninstall packages too:

>> conda remove <package-name>

Extensive conda documentation is available at: https://conda.io/docs/index.html.

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

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