Conda helps you manage python environments on your local machine, keeping your system python free of packages that you may need for your python experiments.
This also installs the Anaconda Prompt
on your system, which can be launched from the start menu.
The Anaconda Prompt allows you to manage your conda environments.
It launches with the base environment activated, denoted by (base)
before the prompt.
To create a new environment, for example with python 3.6 and the scipy package:
conda create -n myenv python=3.6 scipy
Then activate that environment with
conda activate myenv
For more options on managing environments, see the documentation here.
Conda started supporting Powershell from v 4.6. Assuming the Anaconda Prompt is available from the above installation, firstly update conda from within that shell to ensure you're on version >4.6.
conda update -n base conda
Then run:
conda init
Next time you open Powershell, you can use conda commands from there.
The above installation recommends not to add conda to the system PATH, and instead to use the Anaconda Prompt that the installation provisions.
To be able to execute conda commands, such as those for managing environments, from within the VSCode terminal:
- restart VScode from the Anaconda Prompt (using
code .
), after the conda installation and after creating any new environments that need to be available to VScode in the anaconda prompt - install the VScode python extension, if not present
- set python interpreter (Ctrl + Shift + P) to bring up the command pallette, type "Python: Select Interpreter" and select your miniconda installation and desired environment.
The conda environment in use is noted in the VSCode footer.
- Create a conda environment for working locally with Jupyter notebooks
- Install Jupyter in your base conda environment
If you're working in conda and have activated an environment, then your conda-provided python will be in the path. It should not be necessary to make manual additions to your path. On Windows, with a default Miniconda installation, this will be located in
# Base environment
C:\Users\<username>\Miniconda3\
# Other environments
C:\Users\<username>\Miniconda3\envs\<env name>\
This will be in your path when you activate the environment, and contains the version specified when you create the environment. The relevant scripts folder is
# Base environment
C:\Users\<username>\Miniconda3\Scripts
# Other environments
C:\Users\<username>\Miniconda3\envs\<env name>\Scripts
So your system python should not have anything to do anymore! 😴