Skip to content

Instantly share code, notes, and snippets.

@martinsotir
Last active October 7, 2024 15:34
Show Gist options
  • Save martinsotir/2bd2e16332dff71e0fa5be3ed3468a6c to your computer and use it in GitHub Desktop.
Save martinsotir/2bd2e16332dff71e0fa5be3ed3468a6c to your computer and use it in GitHub Desktop.
Enable conda in powershell

Enabling conda in Windows Powershell

First, in an administrator command prompt, enable unrestricted Powershell script execution (see About Execution Policies):

set-executionpolicy unrestricted

Then makes sure that the conda Script directory in is your Path. For instance, with miniconda: %USERPROFILE%\Miniconda3\Scripts.

In a regular Powershell prompt check if conda is working, and update to latest version:

conda update conda
conda --version
# should be conda 4.6.1 or newer

Setup conda for Powershell using the following command:

conda init powershell

Finally, restart powershell. An initialisation script is run every time Powershell starts. You should now be able to activate environment with:

conda activate <my-env>
@monitor1379
Copy link

it works, thanks you!

@SantiagoJN
Copy link

Great solution, thanks!

@Murdock135
Copy link

When I do this, I think the conda-script.py is being called. I don't know why

@QuanyiLi
Copy link

QuanyiLi commented Aug 1, 2024

Thanks for the unrestriction code

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