Skip to content
This repository has been archived by the owner on Jan 30, 2019. It is now read-only.

disable user site packages in conda envs #110

Open
wants to merge 1 commit into
base: develop
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions bin/activate
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,12 @@ else
return $?
fi

if [[ ! -z "${PYTHONUSERSITE+x}" ]]; then
export CONDA_PYTHONUSERSITE="$PYTHONUSERSITE"
fi
# disable user site-packages
export PYTHONUSERSITE=0

# Load any of the scripts found $PREFIX/etc/conda/activate.d
run_scripts "activate"

Expand Down
7 changes: 7 additions & 0 deletions bin/deactivate
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,13 @@ else
return $?
fi

# restore PYTHONUSERSITE env
unset PYTHONUSERSITE
if [[ ! -z "${CONDA_PYTHONUSERSITE+x}" ]]; then
export PYTHONUSERSITE="$CONDA_PYTHONUSERSITE"
fi
unset CONDA_PYTHONUSERSITE

if [[ -n $BASH_VERSION ]]; then
hash -r
elif [[ -n $ZSH_VERSION ]]; then
Expand Down