=========================
Installing conda packages
=========================

You can install the conda package manager with :ref:`Anaconda Distribution or Miniconda <distro-or-miniconda>`. From there, you have several ways in which you can get packages to use in your conda environments:

    * Over :doc:`300 packages <../../anaconda/release-notes>` are automatically installed with Anaconda.
    * Over 7,500 additional open-source packages (including R) can be individually installed from the Anaconda repository with the ``conda install`` command.
    * Thousands of other packages are available from `Anaconda.org <https://anaconda.org/>`__.
    * You can make your own `custom packages <https://conda.io/projects/conda-build/en/latest/>`_ using the ``conda build`` command, and you can share them with others by uploading them to `Anaconda.org <http://anaconda.org>`__, PyPI, or other repositories.
    * You can download and install other Python packages using the pip package manager. See :doc:`Installing packages with pip <pip-install>` for considerations and best practices when using pip.

For more information about using the conda package manager in Anaconda Prompt
(terminal on Linux or macOS), see the `conda documentation <http://conda.io>`_.

You can also use the graphical interface
:doc:`Anaconda Navigator <../../navigator/index>` to install conda packages
with just a few clicks.

Open Anaconda Prompt (terminal on Linux or macOS) and follow these
instructions.

Installing a conda package
==========================

Enter the command::

  conda install package-name


Installing specific versions of conda packages
==============================================

Include the desired version number or its prefix after the package name::

  conda install package-name=2.3.4


To specify only a major version, run::

  conda install package-name=2


These commands install into the environment that is currently active. To
install into a named environment, run::

  conda install package-name=2.3.4 --name some-environment


If the package is specific to a Python version, conda uses the version
installed in the current or named environment. For details on versions,
dependencies and channels, see
`Conda FAQ <https://conda.org/learn/faq/>`_ and
`Conda Troubleshooting <http://conda.pydata.org/docs/troubleshooting.html>`_.


Installing packages on a non-networked (air-gapped) computer
============================================================

To directly install a conda package from your local computer, run::

   conda install /package-path/package-filename.tar.bz2

Conda installs packages into the ``anaconda/pkgs`` directory.

To install a .tar file containing many conda packages, run the following command::

   conda install /packages-path/packages-filename.tar

If conda cannot find the file, try using an absolute path name instead of a relative path name.

.. note::
   Installing packages directly from the file does not resolve dependencies. If your installed package does not work, it may have missing dependencies that need to be resolved manually.

