Skip to content

Instantly share code, notes, and snippets.

@hsaito
Created June 10, 2019 02:30
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save hsaito/1cb9dcfaf2d140d11c78b9ef531ac422 to your computer and use it in GitHub Desktop.
Save hsaito/1cb9dcfaf2d140d11c78b9ef531ac422 to your computer and use it in GitHub Desktop.
Anaconda Initialization Script Module for PowerShell (Linux)
function Initialize-Conda
{
$CONDA_ROOT_DIR = "/path/to/Anaconda" # Change this
[System.Environment]::SetEnvironmentVariable("CONDA_EXE", "$CONDA_ROOT_DIR/Scripts/conda.exe", [System.EnvironmentVariableTarget]::Process)
[System.Environment]::SetEnvironmentVariable("_CE_M", "", [System.EnvironmentVariableTarget]::Process)
[System.Environment]::SetEnvironmentVariable("_CE_CONDA", "", [System.EnvironmentVariableTarget]::Process)
[System.Environment]::SetEnvironmentVariable("_CONDA_ROOT", "$CONDA_ROOT_DIR", [System.EnvironmentVariableTarget]::Process)
[System.Environment]::SetEnvironmentVariable("_CONDA_EXE", "$CONDA_ROOT_DIR/Scripts/conda.exe", [System.EnvironmentVariableTarget]::Process)
Import-Module -Scope Global "$Env:_CONDA_ROOT/bin/conda"
conda activate base
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment