Conda environments don’t work well by default in PowerShell, and the environments don’t show up by default as kernels in Jupyter.
Update 1/29/2019: Conda now officially supports PowerShell. Read more on the blog post.
The ease with which Conda environments can be used in PowerShell varies based on the
version of Conda installed. Check your version by running
With the version 4.6 update, Conda supports PowerShell natively. To configure for PowerShell, run the following:
PS> conda init powershell
conda init command will modify the activate/deactivate scripts and make changes to your
You’ll need to install some additional software in order to use the
commands in PowerShell. Specifically, install the helpful tool from Pavel Koneski
Note that if your PowerShell execution policy is
check), you’ll need to set it to
RemoteSigned by running the following:
PS> Set-ExecutionPolicy -Scope CurrentUser -ExecutionPolicy RemoteSigned
pscondaenvs with Conda:
PS> conda install -n root -c pscondaenvs pscondaenvs
y when prompted to proceed.
pscondaenvs is installed, you’ll have new
commands available that work in PowerShell.
First, activate the desired environment by running
conda activate myenv (or
Ensure dependencies are available by running the following:
(myenv) PS> conda install pip
(myenv) PS> conda install ipykernel
y to proceed as needed. After the installation completes,
run the following command to create a new
ipykernel for this environment:
(myenv) PS> python -m ipykernel install --user --name myenv --display-name "Python (myenv)"
You’ll see the “Python (myenv)” kernel available when you next launch JupyterLab.
Update 2/4/2019: Added notes on new Conda 4.6 init and activation commands for PowerShell.