Skip to content

Instantly share code, notes, and snippets.

@CypherpunkSamurai
Last active June 5, 2025 20:46
Show Gist options
  • Save CypherpunkSamurai/359503fa3a23ea5e493c5eeeaf2de8d4 to your computer and use it in GitHub Desktop.
Save CypherpunkSamurai/359503fa3a23ea5e493c5eeeaf2de8d4 to your computer and use it in GitHub Desktop.
MiniConda portable installation

Minconda Portable Installation

  1. Download Miniconda windows from here: https://repo.anaconda.com/miniconda/ (taken from https://docs.conda.io/en/latest/miniconda.html)
  2. Extract the installer with 7zip. or
conda-installer.exe /InstallationType=JustMe /AddToPath=1 /S /RegisterPython=1 /D=%cd%\conda_install
  1. Rename the conda installation directory.
  2. Make a new bat file, run.bat
  3. Add the following code:
set PATH=%PATH%;%cd%/miniconda3/;%cd%/miniconda3/condabin;%cd%/miniconda3/Scripts

doskey python = %cd%/miniconda3\python.exe $*
doskey pythonw = %cd%/miniconda3\pythonw.exe $*
doskey pip = %cd%/miniconda3\Scripts\pip.exe $*
doskey pip3 = %cd%/miniconda3\Scripts\pip3.exe $*

Edit

This script creates a lot of registry edits that might not be suitable for use in limited environments.

Here's an updated version:

# Get Miniconda
Invoke-WebRequest -Uri "https://repo.anaconda.com/miniconda/Miniconda3-latest-Windows-x86_64.exe"  -OutFile "miniconda.exe"

# Extract the Miniconda package
.\miniconda.exe /InstallationType=JustMe /AddToPath=0 /S /RegisterPython=0 /NoRegistry=1 /NoScripts=1 /NoShortcuts=1 /D=$PWD\conda_install

# Move _conda.exe to conda.exe
Move-Item $pwd\conda_install\_conda.exe $pwd\conda_install\conda.exe

# Note:
# Be sure to add the conda folder to path to use conda
$env:Path = "$env:Path;$pwd\conda_install;$pwd\conda_install\Scripts"

# Optionally
$INSTALL_ENV_DIR="$PWD\conda_python39"
$pwd\conda_install\conda.exe create --no-shortcuts -y -k --prefix "%INSTALL_ENV_DIR%" python=3.9

Regularly Updated At https://gist.github.com/CypherpunkSamurai/73919282a513f63b7c2c4c2d6916c829

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment