Skip to content

Commit

Permalink
Merge pull request conda#9453 from rrigdon/dll-loading-verification
Browse files Browse the repository at this point in the history
DLL loading verification in Activate an Env
  • Loading branch information
jjhelmus authored Dec 10, 2019
2 parents 7a55d79 + a5f470c commit 3a35d7d
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 10 deletions.
22 changes: 17 additions & 5 deletions docs/source/user-guide/tasks/manage-environments.rst
Original file line number Diff line number Diff line change
Expand Up @@ -161,7 +161,7 @@ command used to activate environments created by name::
conda activate ./envs
Specifying a path to a subdirectory of your project directory when
creating an environment has the following benefits:
creating an environment has the following benefits:

* It makes it easy to tell if your project uses an isolated environment
by including the environment as a subdirectory.
Expand Down Expand Up @@ -349,7 +349,7 @@ Anaconda for Just Me, we add it to the user PATH. When you install
for All Users, we add it to the system PATH. In the former case,
you can end up with system PATH values taking precedence over
our entries. In the latter case, you do not. We do not recommend
All Users installs.
`multi-user installs <https://docs.anaconda.com/anaconda/install/multi-user/>`_.

Activation prepends to PATH. This only takes effect
when you have the environment active so it is local to a terminal session,
Expand Down Expand Up @@ -426,15 +426,15 @@ By default, ``conda activate`` will deactivate the current environment
before activating the new environment and reactivate it when
deactivating the new environment. Sometimes you may want to leave
the current environment PATH entries in place so that you can continue
to easily access command line programs from the first environment.
to easily access command line programs from the first environment.
This is most commonly encountered when common command-line utilities
are installed in the base environment. To retain the current environment
in the PATH, you can activate the new environment using:

``conda activate --stack myenv``

If you wish to always stack when going from the outermost environment,
which is typically the base environment, you can set the ``auto_stack``
If you wish to always stack when going from the outermost environment,
which is typically the base environment, you can set the ``auto_stack``
configuration option:

``conda config --set auto_stack 1``
Expand All @@ -443,6 +443,18 @@ You may specify a larger number for a deeper level of automatic stacking,
but this is not recommended since deeper levels of stacking are more likely
to lead to confusion.

Environment variable for DLL loading verification
-------------------------------------------------

If you don't want to activate your environment and you want Python
to work for DLL loading verification, then follow the
:ref:`troubleshooting directions <mkl_library>`.

.. warning::
If you choose not to activate your environment, then
loading and setting environment variables to activate
scripts will not happen. We only support activation.

Deactivating an environment
===========================

Expand Down
11 changes: 6 additions & 5 deletions docs/source/user-guide/troubleshooting.rst
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ Neither the activation, nor the echo will happen. You must write this in your ba
This is known behavior with cmd.exe, and we have not found any way to change it. https://stackoverflow.com/questions/4798879/how-do-i-run-a-batch-script-from-within-a-batch-script/4798965

.. _mkl_library:

NumPy MKL library load failed
=============================
Expand Down Expand Up @@ -61,7 +62,7 @@ If you are not activating your environments, start with doing that. There's more
info at :ref:`Activating environments <activate-env>`. If you are still stuck, you need to consider
more drastic measures.

1. Remove any MKL-related files from C:\\Windows\\System32. We recommend
#. Remove any MKL-related files from C:\\Windows\\System32. We recommend
renaming them to add .bak to the filename to effectively hide them. Observe
if any other software breaks. Try moving the DLL files alongside the .exe of
the software that broke. If it works again, you can keep things in the
Expand All @@ -70,10 +71,10 @@ more drastic measures.
creators of that software. Inform them that their practice of installing
MKL to a global location is fragile and is breaking other people's software
and wasting a lot of time. See the list of guilty parties below.
2. You may try a special DLL loading mode that Anaconda builds into Python.
This changes the DLL search path from system32 first to system32 as another
#. You may try a special DLL loading mode that Anaconda builds into Python.
This changes the DLL search path from System32 first to System32 as another
entry on PATH, allowing libraries in your conda environment to be found
before the libraries in system32. Control of this feature is done with
before the libraries in System32. Control of this feature is done with
environment variables. Only Python builds beyond these builds will react to
these environment variables:

Expand Down Expand Up @@ -102,7 +103,7 @@ more drastic measures.
* CLI: https://superuser.com/questions/79612/setting-and-getting-windows-environment-variables-from-the-command-prompt/79614
* GUI: http://www.dowdandassociates.com/blog/content/howto-set-an-environment-variable-in-windows-gui/

These should be set to a value of ``1`` to enable them. For example, in an anaconda prompt terminal::
These should be set to a value of ``1`` to enable them. For example, in an Anaconda Prompt terminal::

set CONDA_DLL_SEARCH_MODIFICATION_ENABLE=1
Expand Down

0 comments on commit 3a35d7d

Please sign in to comment.