===============
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/continuum.io/forum/?fromgroups#!forum/anaconda>`_. For Continuum Analytics installation or technical support options, visit our `support offerings page <http://continuum.io/support>`_.


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 Command 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=4.4``.

NOTE: Replace ``4.4`` 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 Continuum Analytics builds and includes with Anaconda.


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 command prompt:

   #. From the Start menu, run ``cmd`` to launch the command prompt.
   #. At the command 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.continuum.io/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>`_.
