- Install Miniconda
brew install --cask minicondaMiniconda is the small version of Anaconda: just conda and Python, no extra apps.
- Let your terminal use conda
conda init "$(basename "$SHELL")"Close the terminal and open a new one afterwards. Your prompt now starts with (base).
- Create an environment with its own Python
conda create -n myenv python=3.12Type y when it asks to go ahead. Each environment has its own Python and packages.
- Switch to it
conda activate myenvYour prompt now starts with ({{name}}).
- Install packages into it
conda install numpypip install also works inside a conda environment. Use conda first, pip for anything conda doesn't have.
- See all your environments
conda env listThe one marked with * is the one you're in.
- Switch back out
conda deactivate - Save the environment to a file to share it
conda env export --from-history > environment.yml--from-history keeps only the packages you asked for, so the file works on other computers too.
- Recreate it from that file on another computer
conda env create -f environment.yml
Check it worked
- Check which environment you're in
conda info --envs - Check its Python version
python --version
Undo it
- Leave the environment
conda deactivate - Delete the environment
conda env remove -n myenvYour project files are not touched. Only the environment's Python and packages go.
- Download the Miniconda installer
curl -fsSLo miniconda.sh https://repo.anaconda.com/miniconda/Miniconda3-latest-Linux-x86_64.shOn an ARM computer, swap x86_64 for aarch64.
- Run it
bash miniconda.sh -b -p ~/miniconda3-b installs without questions into ~/miniconda3 in your home folder.
- Let your terminal use conda
~/miniconda3/bin/conda init "$(basename "$SHELL")"Close the terminal and open a new one afterwards. Your prompt now starts with (base).
- Create an environment with its own Python
conda create -n myenv python=3.12Type y when it asks to go ahead. Each environment has its own Python and packages.
- Switch to it
conda activate myenvYour prompt now starts with ({{name}}).
- Install packages into it
conda install numpypip install also works inside a conda environment. Use conda first, pip for anything conda doesn't have.
- See all your environments
conda env listThe one marked with * is the one you're in.
- Switch back out
conda deactivate - Save the environment to a file to share it
conda env export --from-history > environment.yml--from-history keeps only the packages you asked for, so the file works on other computers too.
- Recreate it from that file on another computer
conda env create -f environment.yml
Check it worked
- Check which environment you're in
conda info --envs - Check its Python version
python --version
Undo it
- Leave the environment
conda deactivate - Delete the environment
conda env remove -n myenvYour project files are not touched. Only the environment's Python and packages go.
- Install Miniconda
winget install -e --id Anaconda.Miniconda3Miniconda is the small version of Anaconda: just conda and Python, no extra apps. You can also use the Anaconda Prompt app it adds to the Start menu.
- Let your terminal use conda
conda init powershellIf conda isn't found, run this from the Anaconda Prompt app. Then close PowerShell and open a new one; your prompt starts with (base).
- Create an environment with its own Python
conda create -n myenv python=3.12Type y when it asks to go ahead. Each environment has its own Python and packages.
- Switch to it
conda activate myenvYour prompt now starts with ({{name}}).
- Install packages into it
conda install numpypip install also works inside a conda environment. Use conda first, pip for anything conda doesn't have.
- See all your environments
conda env listThe one marked with * is the one you're in.
- Switch back out
conda deactivate - Save the environment to a file to share it
conda env export --from-history | Out-File -Encoding utf8 environment.yml--from-history keeps only the packages you asked for, so the file works on other computers too.
- Recreate it from that file on another computer
conda env create -f environment.yml
Check it worked
- Check which environment you're in
conda info --envs - Check its Python version
python --version
Undo it
- Leave the environment
conda deactivate - Delete the environment
conda env remove -n myenvYour project files are not touched. Only the environment's Python and packages go.