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


.. contents::
   :local:
   :depth: 1

|

If you have a troubleshooting issue that is not listed here, obtain free support
for Anaconda through the
`Anaconda mailing list
<https://groups.google.com/a/anaconda.com/forum/?fromgroups#!forum/anaconda>`_.
For Anaconda installation or technical support options, visit our
`support offerings page <http://anaconda.com/support>`_.

Anaconda installer download problems
====================================

Cause
-----

The Anaconda installer files are large (over 300 MB), and some users have
problems with errors and interrupted downloads when downloading large files.

Solution
--------

One option is to download and install the smaller `Miniconda
<https://conda.io/miniconda.html>`_ (under 60MB) and then use the command
``conda install anaconda`` to download and install all the remaining packages
in Anaconda. If the package downloads are interrupted, just run
``conda install anaconda`` again. Conda only downloads the packages that were
not finished in any previous attempts.

A second option is to download the large Anaconda installer file, and restart
it if the download is interrupted or you need to pause it.

**Windows**

If you use Internet Explorer:

#. Click the Settings icon.
#. Click "View Downloads" to open the Download Manager.
#. Click on the "Resume" button next to the stopped download to restart
   downloading. The download resumes at the point where it stopped.

If you use Edge browser:

#. In Windows Explorer, open your downloads folder. There will be
   temporary files there associated with the partial downloads. Delete all of
   the temporary files except for the download you want to resume.
#. In Edge, click the file to download it again. Pause the download but do not
   cancel it.
#. In Windows Explorer, open your downloads folder. You will see two files: the
   partially downloaded file from earlier, and the paused download you just
   started. Copy the name of the file you just started, delete this file, and
   rename the other file with the copied name.
#. In Edge, resume the download.

If you use Chrome browser:

Download the plugin for Chrome called Chrono Download manager. In your Chrome
browser, go to https://chrome.google.com/webstore/category/extensions, search
on "Chrono Download" and select, "Add to Chrome."

To resume the download using Chrono Download, from your top browser menu, click
on the Chrome menu button, then click "Downloads." Select the filename, then
click "Resume" to restart your download.


**macOS and Linux**

* In your terminal window, download the file with the command
  ``curl -O FILENAME``.

  NOTE: Replace FILENAME with the full path and name of the file, including
  ``http://`` or ``https://``.

* To pause the download, use ``CTRL-c``.

  NOTE: While a download is paused, you can shut down or restart your computer.

* When ready to resume your download, use ``curl -O -C FILENAME``.

  Where "-C" is the option for "continue". You can pause and restart a download
  as many times as you wish.


Cannot see Anaconda menu shortcuts after installation on Windows
================================================================

After installing on Windows, in the Windows Start menu I cannot see Anaconda
prompt, Anaconda Cloud and Navigator shortcuts.

Cause
-----

This is caused by the way Windows updates the Start menu.

Solution
--------

If start menu shortcuts are missing, Microsoft recommends rebooting your
computer or `restarting Windows Explorer
<https://answers.microsoft.com/en-us/windows/forum/windows8_1-performance/force-refresh-of-start-menu-start-screen-in/ee4e36d2-91d0-4f34-9eb8-b17ab096e83c?auth=1>`_.

Windows error: Failed to create Anaconda menus or Failed to add Anaconda to the system PATH
===========================================================================================

During installation on a Windows system, a dialog box appears that says "Failed to create Anaconda menus, Abort Retry Ignore" or "Failed to add Anaconda to the system PATH." There are many possible Windows causes for this.

Solution
--------

Try these solutions, in order:

* Do not install on a PATH longer than 1024 characters
* Turn off anti-virus programs during install, then turn back on
* Uninstall all previous Python installations
* Clear all PATHs related to Python in sysdm.cpl file
* Delete any previously set up Java PATHs
* If JDK is installed, uninstall it.

I'm having trouble with the Anaconda installer on Windows. How can I debug my issue?
====================================================================================

Cause
-----

The cause could be any number of issues.

Solution
--------

Anaconda 4.4 added a feature to the Windows installer so that the "verbose" install information is printed out to a special debug stream via the Win32 API function OutputDebugStream. To see these messages, during installation you need to run the Microsoft utility https://technet.microsoft.com/en-us/sysinternals/debugview.aspx. This may provide useful clues for troubleshooting or submitting bug reports.

Cannot get conda to run after installing
========================================

You may get "conda not found" or "conda is not recognized as an internal or external command" or a similar message, and you cannot execute conda in a terminal window regardless of what path you are on.

Cause
-----

Most likely when you were installing Anaconda or Miniconda, you answered "NO" to the question whether or not to prepend the conda prompt to your path.

Solution
--------

Uninstall and then reinstall Anaconda or Miniconda, answering "YES" to the question about prepending the conda prompt.

Or, you can manually edit your .bashrc file to prepend the Anaconda or Miniconda install location. Open a text editor and in your home directory, locate the hidden file .bashrc. Add this line to it and save::

    export PATH=/Users/your-username/anaconda3/bin:$PATH

NOTE: Replace "your-username" with your username.

Close your terminal window and re-open before running a conda command.

Insecure Platform Warning
=========================

Cause
-----

"InsecurePlatformWarning" appears only when the installed version of Python is
older than version 2.7.9. This message warns only that the validity of the SSL
connection is not being verified. It should not affect your package downloads.

Solution
--------

To resolve this on Windows, install the updated package ``ndg-httpsclient``::

  conda install ndg-httpsclient

NOTE: When initially installing this package, you receive the SSL warning again. Once it is installed, the package will prevent the warnings.


Error message: Conda: command not found, on macOS or Linux
==========================================================

Cause
-----

Problems with the PATH environment variable can cause "conda: command not found" errors or a failure to load the correct versions of python or ipython.

Solution
--------

#. Find the location of your Anaconda binary directory.
#. In your home directory, in the ``.bashrc`` file, add a line to add that location to your PATH.
#. Close and then re-open your terminal windows.

EXAMPLE: A user with the user name "jsmith" on a Linux machine whose Anaconda
binary directory is ``~/anaconda`` would add this line to the ``.bashrc`` file::

  export PATH="/home/jsmith/anaconda/bin:$PATH"


Anaconda interfering with other software on Windows
===================================================

Cause
-----

If a user chooses to add Anaconda to the Windows PATH, this can cause programs
to use the new Anaconda versions of software such as Python and not the
versions that were already in place. In some cases this can cause
incompatibility and errors.

Solution
--------

We recommend not adding Anaconda to the Windows PATH. Instead, use Anaconda
software by opening Anaconda Navigator or the Anaconda Prompt from the
Start Menu.


MKL Trial warning is displayed even though MKL-linked packages are now free and installed by default
====================================================================================================

See `Dismissing MKL Trial
warnings <../mkl-optimizations/index.html#dismissing-mkl-trial-warnings>`_.


Error message: Permission denied, when loading MKL shared libraries
===================================================================

See `Resolving MKL shared library permission denied
errors <../mkl-optimizations/index.html#resolving-mkl-shared-library-permission-denied-errors>`_.


Error message on Miniconda install: Already installed
=====================================================

Cause
-----

This situation can occur if you are getting a conda error and you want to reinstall Miniconda to fix it.

Solution
--------

For macOS and Linux, download and install the appropriate Miniconda for your operating system from the `Miniconda download page <http://conda.pydata.org/miniconda.html>`_ using the force or -f option:

.. code-block:: rst

    bash Miniconda3-latest-MacOSX-x86_64.sh -f

NOTE: For ``Miniconda3-latest-MacOSX-x86_64,`` substitute the appropriate filename and version for your operating system.

NOTE: Be sure that you install to the same location as your existing install so it overwrites the core conda files and does not install a duplicate in a new folder.


Conda update anaconda command does not install the latest version of Anaconda
=============================================================================

Cause
-----

For users who have installed packages that are not compatible with the latest version of the Anaconda metapackage,  running ``conda update anaconda`` updates the Anaconda metapackage to the latest compatible version, but this may not be the latest version.

Solution
--------

Obtain a list of the conflicting packages by running ``conda update anaconda`` or ``conda install anaconda=5.0``.

NOTE: Replace ``5.0`` with the latest version number.

Once you know which packages are conflicting, you can update all current packages without upgrading to the latest version of Anaconda, or you can remove the conflicting packages and then upgrade to the latest version of Anaconda.

To update all current packages without upgrading to the latest version of Anaconda:

#. Use ``conda remove anaconda`` to remove the Anaconda metapackage itself. (This will not remove any of the packages included with Anaconda.)
#. Use ``conda update --all`` to update all currently installed packages.

To remove the conflicting packages and upgrade to the latest version of Anaconda:

#. Remove the conflicting packages by running ``conda remove package-name`` for each one.

   NOTE: Replace ``package-name`` with the name of the package.

#. Run ``conda update anaconda``.


Linking problems when Python extensions are compiled with gcc
=============================================================

Cause
-----

When compiling Python extensions with gcc on Windows, linking problems may result.

Solution
--------

To resolve these linking problems, use the mingw import library--the conda package libpython--which Anaconda builds and includes with the Anaconda distribution.


Error message: Unable to remove files
=====================================

When trying to update or install packages with conda, you may see an error message such as::

    Error: Unable to remove files for package: <package-name>
    Please close all processes running code from conda and try again.

Cause
-----

This may be caused by a file lock issue.

Solution
--------

Before updating or installing any packages with conda, be sure to terminate any running Anaconda processes such as Spyder or IPython.

You can also force the installation of the package: ``conda install -f package-name``.

NOTE: Replace ``package-name`` with the name of the package that you want to install.


Files left behind after uninstalling Anaconda on Windows
========================================================

Cause
-----

Some users may need to keep settings files and other users may need to delete them, so Anaconda leaves some settings files in place when it is uninstalled. Specifically, the directories ``.spyder2``, ``.ipython``, ``.matplotlib``, and ``.astropy`` remain. Depending on your version of Windows these may be in ``C:\Documents and Settings\Your_User_Name`` or in ``C:\Users\Your_User_Name``.

NOTE: Replace ``Your_User_Name`` with your Windows user name as it appears in the ``Documents and Settings`` or ``Users`` folder.

Solution
--------

Manually delete any unneeded settings files.


Spyder errors or failure to launch on Windows
=============================================

Cause
-----

This may be caused by errors in the Spyder setting and configuration files.

Solution
--------

#. Close and relaunch Spyder and see if the problem remains.
#. On the menu, select Start, then select Reset Spyder Settings and see if the problem remains.
#. Close Spyder and relaunch it from the Anaconda Prompt:

   #. From the Start menu, open the Anaconda Prompt.
   #. At the Anaconda Prompt, enter ``Spyder``.
   #. See if the problem remains.

#. Delete the directory ``.spyder2``  and then repeat the previous steps from Step 1. Depending on your version of Windows, ``.spyder2`` may be in ``C:\Documents and Settings\Your_User_Name`` or in ``C:\Users\Your_User_Name``.

   NOTE: Replace ``Your_User_Name``, with your Windows user name as it appears in the `Documents and Settings` folder.


Problems running Anaconda on macOS 10.12.2
==========================================

Cause
-----

Some installations of Anaconda on macOS 10.12.2 experienced incorrect file and
directory permissions, which caused a range of errors with Navigator and other
parts of Anaconda.

Solution
--------

We recommend that any users with Anaconda on macOS 10.12.2 follow these steps:

#. Uninstall Anaconda. Open the Terminal.app or iTerm2 terminal application and
   remove your Anaconda directory, which will have a name such as "anaconda2"
   or "anaconda3", by entering a command such as this: ``rm -rf ~/anaconda3``
#. Use a text editor such as TextEdit to open the file named ``.bash_profile``
   in your home directory. If you see a line that adds Anaconda or Miniconda to
   your PATH environment variable, remove this line, and then save and close
   the file. For example, if you see a line such as
   ``export PATH="/Users/jsmith/anaconda3/bin:$PATH"``, remove that line.
#. Update to macOS 10.12.3 or later.
#. `Reinstall Anaconda <https://www.anaconda.com/downloads>`_.


"execution error: localhost doesn't understand the "open location" message. (-1708)" when opening a Jupyter notebook on macOS 10.12.5
=====================================================================================================================================

Cause
-----

This version of macOS seems to have a bug affecting some of the ways for a program to open a web page in a browser.

Solution
--------

Several possible workarounds have been found for this bug.

You can explicitly set the browser in ``~/.jupyter/jupyter_notebook_config.py`` with a line such as this::

    c.NotebookApp.browser = u'Safari'

Or you can copy the Jupyter notebook URL from the log messages on the command line and paste it into your browser.

Or you can set the BROWSER environment variable: ``export BROWSER=/Applications/Google\ Chrome.app/Contents/MacOS/Google\ Chrome``

Further information is available at the `Jupyter bug tracker <https://github.com/jupyter/notebook/issues/2438>`_, the `Python bug tracker <https://bugs.python.org/issue30392>`_, and `this blog post <http://www.andrewjaffe.net/blog/2017/05/python-bug-hunt.html>`_.


Missing libgfortran on Power8
=============================

Cause
-----

Anaconda 4.4.0.0 for Power8 did not include libgfortran.

Solution
--------

Anaconda 4.4.0.1 and later for Power8 do include libgfortran.

Upgrade to the latest version of Anaconda::

    conda update anaconda

Anaconda 4.4.0.0 users who do not wish to upgrade may instead install libgfortran with this command::

    conda install libgfortran


Missing libgomp on Power8
=========================

If the Python command "import numpy" fails, the system is likely missing the
libgomp system library.

Cause
-----

Most Power8 Linux distributions include libgomp, but some may not.

Solution
--------

Check whether the system is missing libgomp with this command::

    conda inspect linkages -n root numpy

If libgomp.so.1 is listed in the "not found:" section, it must be installed.

Install libgomp on Ubuntu with this command::

    apt install libgomp1

Install libgomp on Red Hat Enterprise Linux (RHEL) or CentOS with this command::

    yum install libgomp

Anaconda on Power8 reports "can not execute binary file"
========================================================

Cause
-----

Anaconda on Power8 only supports little endian mode. The little endian Python binary will not execute on a big endian operating system.

Solution
--------

Install Anaconda on Power8 on a little endian Linux installation or VM.
