+# Add this to your Anaconda2/Scripts directory alongside the standard "deactivate" script.
+# The only change is at line 91. The problem is that conda can't handle "/cygdrive/..."
+# style pathnames. The added call to "cygpath" corrects the pathname.
+# Determine the directory containing this script
+if [[ -n $BASH_VERSION ]]; then
+ _SCRIPT_LOCATION=${BASH_SOURCE[0]}
+elif [[ -n $ZSH_VERSION ]]; then
+ _SCRIPT_LOCATION=${funcstack[1]}
+ echo "Only bash and zsh are supported"
+_CONDA_DIR=$(dirname "$_SCRIPT_LOCATION")
+ export MSYS2_ENV_CONV_EXCL=CONDA_PATH
+# shift over all args. We don't accept any, so it's OK that we ignore them all here.
+ "$_CONDA_DIR/conda" ..deactivate $_SHELL$EXT -h
+ if [[ -n $BASH_VERSION ]] && [[ "$(basename "$0" 2> /dev/null)" == "deactivate" ]]; then
+ shift # past argument or value
+# Ensure that this script is sourced, not executed
+# Note that if the script was executed, we're running inside bash!
+# Also note that errors are ignored as `activate foo` doesn't generate a bad
+# value for $0 which would cause errors.
+if [[ -n $BASH_VERSION ]] && [[ "$(basename "$0" 2> /dev/null)" == "deactivate" ]]; then
+ (>&2 echo "Error: deactivate must be sourced. Run 'source deactivate'
+instead of 'deactivate'.
+ "$_CONDA_DIR/conda" ..deactivate $_SHELL$EXT -h
+if [[ -z "$CONDA_PATH_BACKUP" ]]; then
+ if [[ -n $BASH_VERSION ]] && [[ "$(basename "$0" 2> /dev/null)" == "deactivate" ]]; then
+ # Inverse of activation: run deactivate scripts prior to deactivating env
+ _CONDA_D="${CONDA_PREFIX}/etc/conda/deactivate.d"
+ if [[ -d $_CONDA_D ]]; then
+ eval $(find "$_CONDA_D" -iname "*.sh" -exec echo source \'{}\'';' \;)
+# # get the activation path that would have been provided for this prefix
+# _LAST_ACTIVATE_PATH=$("$_CONDA_DIR/conda" ..activate $_SHELL$EXT "$CONDA_PREFIX")
+# # in activate, we replace a placeholder so that conda keeps its place in the PATH order
+# # The activate script sets _CONDA_HOLD here to activate that behavior.
+# # Otherwise, PATH is simply removed.
+# if [ -n "$_CONDA_HOLD" ]; then
+# export PATH="$($_CONDA_PYTHON2 -c "import re; print(re.sub(r'$_LAST_ACTIVATE_PATH(:?)', r'CONDA_PATH_PLACEHOLDER\1', '$PATH', 1))")"
+# export PATH="$($_CONDA_PYTHON2 -c "import re; print(re.sub(r'$_LAST_ACTIVATE_PATH(:?)', r'', '$PATH', 1))")"
+# unset _LAST_ACTIVATE_PATH
+ # Added by rjp to convert cydrive path back to Windows drive letter
+ CONDA_PREFIX=$(cygpath -w $CONDA_PREFIX)
+ export PATH=$("$_CONDA_DIR/conda" ..deactivate.path $_SHELL$EXT "$CONDA_PREFIX")
+ unset CONDA_DEFAULT_ENV
+ unset CONDA_PATH_BACKUP
+ export PS1="$CONDA_PS1_BACKUP"
+if [[ -n $BASH_VERSION ]]; then
+elif [[ -n $ZSH_VERSION ]]; then