===============
Troubleshooting
===============

This page details some common issues and their respective workarounds. For Anaconda installation or technical support options, visit our `support offerings page <http://anaconda.com/help>`_.

.. tip:: 

    You can search this page for information using your browser's search function: Ctrl+F (Windows)/Cmd+F (Mac).

.. include:: ../reusetext/troubleshooting.rst

Environment creation failing due to policy filter
-------------------------------------------------

.. dropdown:: Cause
    :animate: fade-in
    :color: primary

        Implementing strict policy filters with no exceptions can cause essential package dependencies to be filtered out of your repository. Without these packages, commands like ``conda create --name <ENV_NAME> python=3.11`` will fail. 

        If you are attempting to create a new environment, but your build is failing due to package conflicts or unavailable packages, it's likely due to your IT team's strict policy filter. You can request that package exceptions can be added to a policy filter, but you'll need to know which packages are causing problems first.

.. dropdown:: Solution
    :animate: fade-in
    :color: primary

        To perform this test, you'll need a channel that has no policy filter applied to it. Create the channel in your organization and name it ``quarantine``. Once created, add it to your ``.condarc`` file. For help adding a channel to your ``.condarc`` file, see :doc:`Channels <channels>`.

        With your quarantine channel created and added to your ``.condarc`` file, you can run the following command:

    .. code-block:: none 

        # Replace <ENV_NAME> with a test environment name (this is not permanent)
        # Replace <CHANNEL> with your channel name
        conda create --name <ENV_NAME> --channel <CHANNEL> --channel quarantine python=3.11 --dry-run

    .. note:: 

        If you have your channel alias set in your ``.condarc``, you can use just the channel name with the ``--channel`` argument. If you do not, you can use the full channel URL with the ``--channel`` argument. You can copy the channel URL from your Channels page. For more information on setting your channel alias, see `Using the .condarc conda config file <https://docs.conda.io/projects/conda/en/latest/user-guide/configuration/settings.html#channel-alias-set-a-channel-alias>`_.

    For example, if you are trying to test building an environment from the *snakes* channel, the command would be:

    .. code-block:: none

        conda create --name test_environment --channel snakes --channel quarantine python=3.11 --dry-run

    .. caution:: 

        The ordering of ``snakes`` and ``quarantine`` is essential. Conda will attempt to solve the environment in the order the channels are listed, so ``quarantine`` must be listed last.

    Example command return:
    
    .. code-block:: none 

        ## Package Plan ##

            environment location: /Users/<USER>/opt/anaconda3/envs/test_env

            added / updated specs:
            - python=3.11

        The following packages will be downloaded:

            package                    |            build
            ---------------------------|-----------------
            bzip2-1.0.8                |       h80987f9_5         129 KB  snakes
            ca-certificates-2023.12.12 |       hca03da5_0         127 KB  snakes
            libffi-3.4.4               |       hca03da5_0         120 KB  snakes
            ncurses-6.4                |       h313beb8_0         884 KB  quarantine
            openssl-3.0.13             |       h1a28f6b_0         5.0 MB  quarantine
            pip-23.3.1                 |  py311hca03da5_0         3.3 MB  quarantine
            python-3.11.8              |       hb885b13_0        15.5 MB  snakes
            readline-8.2               |       h1a28f6b_0         353 KB  snakes
            setuptools-68.2.2          |  py311hca03da5_0         1.2 MB  snakes
            sqlite-3.41.2              |       h80987f9_0         1.1 MB  quarantine
            tk-8.6.12                  |       hb8d0fd4_0         2.9 MB  snakes
            tzdata-2024a               |       h04d1e81_0         116 KB  snakes
            wheel-0.41.2               |  py311hca03da5_0         142 KB  quarantine
            xz-5.4.6                   |       h80987f9_0         372 KB  snakes
            zlib-1.2.13                |       h5a0b063_0          82 KB  quarantine
            ------------------------------------------------------------
                                           Total:        31.4 MB

        The following NEW packages will be INSTALLED:

            bzip2              snakes/osx-arm64::bzip2-1.0.8-h80987f9_5
            ca-certificates    snakes/osx-arm64::ca-certificates-2023.12.12-hca03da5_0
            libffi             snakes/osx-arm64::libffi-3.4.4-hca03da5_0
            ncurses            quarantine/osx-arm64::ncurses-6.4-h313beb8_0
            openssl            quarantine/osx-arm64::openssl-3.0.13-h1a28f6b_0
            pip                quarantine/osx-arm64::pip-23.3.1-py311hca03da5_0
            python             snakes/osx-arm64::python-3.11.8-hb885b13_0
            readline           snakes/osx-arm64::readline-8.2-h1a28f6b_0
            setuptools         snakes/osx-arm64::setuptools-68.2.2-py311hca03da5_0
            sqlite             quarantine/osx-arm64::sqlite-3.41.2-h80987f9_0
            tk                 snakes/osx-arm64::tk-8.6.12-hb8d0fd4_0
            tzdata             snakes/noarch::tzdata-2024a-h04d1e81_0
            wheel              quarantine/osx-arm64::wheel-0.41.2-py311hca03da5_0
            xz                 snakes/osx-arm64::xz-5.4.6-h80987f9_0
            zlib               quarantine/osx-arm64::zlib-1.2.13-h5a0b063_0

        DryRunExit: Dry run. Exiting.

    Packages that were retrieved from the ``quarantine`` channel are the packages that need to be considered for exceptions in the policy filter.
