Run Conda commands in Windows Powershell


Learn how to run conda commands directly in Windows PowerShell. By default, Windows PowerShell doesn’t support conda commands, which can be frustrating when working with Jupyter Lab or other Python development tools.

Important: This video shows Anaconda, but I now recommend using Miniforge instead (Anaconda now requires paid licenses for most institutions). The steps below work exactly the same with Miniforge – just use “Miniforge Prompt” instead of “Anaconda Prompt” in step 1.

Step-by-Step Guide

1. Initialize Conda for PowerShell
– Open Anaconda Prompt (or Miniforge Prompt)
– Run the following command:

conda init powershell

– Wait for the initialization to complete

2. Update PowerShell Execution Policy
– Open PowerShell
– Run the following command:

Set-ExecutionPolicy -ExecutionPolicy RemoteSigned -Scope CurrentUser

– This allows signed scripts to run on your system

3. Verify the Setup
– Restart PowerShell
– You’ll notice it takes slightly longer to load initially
– The base environment should be automatically activated
– Test by running a simple conda command

Benefits

After completing these steps, you can:
– Run conda commands directly from PowerShell
– Install environments from within Jupyter Lab’s terminal
– Manage Python environments without switching to Anaconda Prompt
– Streamline your development workflow

Troubleshooting

If conda commands still don’t work:
– Make sure you restarted PowerShell after running the init command
– Check that the execution policy change was applied
– Verify that Anaconda/Miniforge is properly installed

If you see security warnings:
– The RemoteSigned policy is safe for development work
– It only allows scripts signed by trusted publishers to run
– Your locally created scripts can still run


This tutorial is part of our Python development workflow series. Visit Training Scientists for more practical Python tutorials and tips.

Share:

More Posts

Scroll to Top