Shared Setup (Windows) — Miniconda, Course Environments, IPython, and JupyterLab
You will use the same core setup in both of these courses:
- CMSC-1217 Introduction to Data Analytics
- CMSC-2208 Introduction to Machine Learning
The difference between the courses is which environment/packages you install and which tools are emphasized. This page includes small callouts to help you follow the right parts at the right time.
Overview
In these courses, you will work inside a conda environment. An environment is an isolated Python installation (Python + packages) stored in a folder on your computer. This helps everyone use consistent tools and reduces setup conflicts.
You will use the following tools:
- Miniconda Miniconda is a small installer that provides Conda, a system for managing Python installations and packages. Miniconda does not include many data-science packages by default; instead, it gives you a controlled way to install exactly what a course requires.
- Conda (the environment manager) Conda is software that can create, activate, and manage environments. It can also install packages (libraries) in a way that keeps them consistent and reduces compatibility problems, especially for scientific packages.
- Conda environment A conda environment is a self-contained folder that contains:
- a specific version of Python, and
- a specific set of installed packages. Each environment is separate from other environments on your computer. This means one course can use one set of packages (and versions) without affecting another course or your personal Python installation.
- JupyterLab (notebook workspace) JupyterLab is a browser-based programming environment used for data analysis and machine learning. It allows you to write code in cells, run those cells, and view output (tables, plots, printed results) directly below the code. JupyterLab is used in both courses because it supports step-by-step work and makes it easier to review results.
- IPython (interactive Python terminal — CMSC-1217 only) IPython is an enhanced interactive Python terminal. It provides features that support exploratory work, such as command history, tab completion, and built-in help. In CMSC-1217, IPython is used to practice interactive exploration and reinforce core Python concepts in a terminal-based workflow.
How these pieces fit together
Miniconda installs Conda, and Conda is the tool you use to create a course environment. When you activate that environment, your terminal temporarily switches so that the python command (and tools like jupyter) run from the environment’s folder. You then start Jupyter (JupyterLab or Jupyter Notebook), and the notebook runs Python from the active environment, using the packages installed there. This sequence—install Miniconda → create environment → activate environment → start Jupyter → run notebooks—is the standard workflow you will use throughout the course.
Important: During Miniconda installation, do not add Miniconda to PATH. We will use the Miniconda/Anaconda Prompt when working for these courses.
1) Install Miniconda
- Download and install Miniconda (64-bit) for Windows. https://www.anaconda.com/download
- During installation, do not add Miniconda to PATH.
Why not add to PATH: Many of you already have a Python installation from python.org. Not adding Miniconda to PATH prevents Miniconda from changing which python runs in non-course terminals.
Miniconda is a lightweight installer that provides:
- Conda (a package and environment manager), and
- a basic Python installation and its dependencies.
Miniconda is intentionally minimal: it does not install a large collection of data-science packages by default. Instead, you install only the packages required for the course.
Relationship to Anaconda
Miniconda and Anaconda are closely related:
- Anaconda Distribution is a larger installer that comes with hundreds of packages pre-installed, plus optional tools like Anaconda Navigator.
- Miniconda is a smaller installer that includes only conda, Python, and a small core set of packages, and then you add what you need.
For these courses, Miniconda is a good fit because it helps us keep your course environment clean, consistent, and easier to troubleshoot.
Why Miniconda/Conda is common in data analysis and machine learning
Data analysis and machine learning often rely on libraries that include compiled components. Conda is widely used in these areas because it can install many scientific packages as prebuilt binaries, which reduces installation difficulties (especially on Windows).
Conda also supports creating separate environments so different projects can use different versions of Python/packages without interfering with each other.
2) Open the conda terminal
Open Anaconda Command Prompt from the Start menu.
You should see something like:
(base) C:\Users\yourname>
Why we use this terminal
Anaconda/Miniconda Prompt is a terminal that is already configured to recognize conda commands such as conda createand conda activate. Using this prompt reduces setup errors because it starts with the correct conda settings.
What (base) means
(base) indicates that you are currently in conda’s default environment. This environment exists mainly so that conda can run and manage other environments. In this course, you will usually not do your work in (base). Instead, you will create and activate a course environment (for example, pydata-book or cmsc-2208) and work there.
How to interpret the prompt
The name in parentheses is your current environment:
(base)means you are in the default conda environment(pydata-book)or(cmsc-2208)means you are in the course environment
A quick habit that prevents many problems: before running course commands, look at the parentheses and confirm you are in the correct environment.
3) Configure conda package channels
Run the following two commands, one at a time, pressing Enter after each.
First, run:
conda config --add channels conda-forgeThen, run:
conda config --set channel_priority strictConda downloads packages from sources called channels. A channel is a repository that hosts packaged software (similar in purpose to an “app store,” but for programming libraries). When you install a package with conda, conda searches the configured channels to find a compatible version of that package and its dependencies.
We use conda-forge because it is a widely used community-maintained channel that provides current, well-tested builds of many scientific and data-analysis libraries (for example, NumPy, pandas, matplotlib, and scikit-learn). Using a consistent channel helps ensure that most students receive the same package builds and reduces platform-specific installation problems.
Setting strict channel priority means conda will prefer packages from the highest-priority channel (in this case, conda-forge) rather than mixing packages from multiple channels. This matters because mixing package sources can sometimes lead to version conflicts or dependency mismatches. Strict priority reduces those problems by keeping package selection consistent.
4) Create the course environment
You will create one conda environment for the course you are taking currently.
What an environment is:
In programming, an environment is the set of software used to run your code, such as:
- the language runtime (for us, Python),
- installed libraries/packages,
- and related tools (such as Jupyter).
Many languages and toolchains support environments (for example, Python can use virtual environments, and other ecosystems have their own dependency managers). The goal is the same: keep project dependencies organized and consistent.
What a conda environment is:
In this course we use a conda environment, which is a self-contained folder on your computer that includes:
- a specific version of Python, and
- a specific set of installed packages.
We use conda because it provides a consistent way to install scientific and data-analysis libraries (especially on Windows) and makes it straightforward to reproduce the same setup across different computers.
Do not create both environments.
If you are in CMSC-1217 Introduction to Data Analytics
Run this command (then press Enter):
conda create -n pydata-book python=3.11If prompted, type y.
This creates an environment named pydata-book. The name is just a label for this course’s Python setup.
If you are in CMSC-2208 Introduction to Machine Learning
Run this command (then press Enter):
conda create -n cmsc-2208 python=3.11If prompted, type y.
This creates an environment named cmsc-2208. The name is just a label for this course’s Python setup.
5) Activate the environment (choose your course)
Before installing packages or starting JupyterLab, you must activate your course environment.
What “activate” means: It tells the terminal to use the Python and packages inside your course environment. When the environment is active, commands like python and jupyter will run from the correct course setup.
You will activate one environment: the one for the course you are taking now.
If you are in CMSC-1217 Introduction to Data Analytics
Run:
conda activate pydata-bookIf you are in CMSC-2208 Introduction to Machine Learning
Run:
conda activate cmsc-2208After you activate, your prompt will begin with the environment name, for example:
(pydata-book) ...(cmsc-2208) ...
Rule: Before you do course work, confirm that the prompt shows your course environment name.
6) Install packages (inside the active environment)
A) CMSC-1217 packages
With (pydata-book) active, run:
conda install -c conda-forge numpy pandas=2.0.3 matplotlib jupyterlab notebook ipykernelThis installs:
- numpy: arrays and numerical computing
- pandas: data tables (DataFrames)
- matplotlib: plotting
- jupyterlab: notebook interface
- ipykernel: the component that allows this environment to run notebooks as a Jupyter kernel
CMSC-1217 only: You will also use IPython in this course. IPython will work once the environment is active.
B) CMSC-2208 packages (required)
With (cmsc-2208) active, run:
conda install -c conda-forge numpy pandas matplotlib jupyterlab notebook ipykernel scikit-learn scipyThis installs the data stack plus the machine learning libraries used in CMSC-2208.
7) Verify your installation (imports + version confirmation)
Run this command in the active environment:
python -c "import sys; import numpy as np; import pandas as pd; import matplotlib; print('python', sys.version.split()[0]); print('numpy', np.__version__); print('pandas', pd.__version__); print('matplotlib', matplotlib.__version__)"What this step is doing (and why it can take a moment):
This command does two things:
- Imports the core libraries (
numpy,pandas,matplotlib). Importing is the real verification step. It confirms the packages are installed correctly in this environment and that Python can load them without errors. - Prints version numbers after the imports succeed. This helps confirm you are using the expected tool versions for the course.
Because these libraries are large and include compiled components, the first successful import in a new environment may take longer than you expect. That is normal.
CMSC-2208 only
For CMSC-2208, also verify:
python -c "import sklearn, scipy; print('sklearn', sklearn.__version__); print('scipy', scipy.__version__)"This confirms that the machine learning libraries required for the course can be imported correctly in the CMSC-2208 environment.
8) Create the course folder structure (choose your course)
You will create a small folder structure on your C: drive so your files stay organized and easy to find.
Run the commands for your course only. Run them one at a time, pressing Enter after each command.
If you are in CMSC-1217 Introduction to Data Analytics
Run the following four commands:
First:
mkdir C:\cmsc-1217Then:
mkdir C:\cmsc-1217\course-workThen:
mkdir C:\cmsc-1217\bookFinally:
mkdir C:\cmsc-1217\dataIf you are in CMSC-2208 Introduction to Machine Learning
Run the following four commands:
First:
mkdir C:\cmsc-2208Then:
mkdir C:\cmsc-2208\course-workThen:
mkdir C:\cmsc-2208\bookFinally:
mkdir C:\cmsc-2208\dataWhat these folders are for (both courses)
course-work: your weekly work and submissionsbook: companion notebooks (reference materials)data: datasets used in course work
Note: If you see a message like “A subdirectory or file already exists,” that usually means you already created the folder. That is fine—continue to the next command.
9) Install Git (if needed)
Check:
git --versionIf Git is not installed, install Git for Windows, then re-check git --version.
10) Download the book companion files (choose your course)
Each course uses a GitHub repository that contains companion files (notebooks, datasets, and examples). You will download the repository into your course book folder.
Run the commands for your course only. Run them one at a time, pressing Enter after each command.
If you are in CMSC-1217 Introduction to Data Analytics
First, move into your book folder:
cd C:\cmsc-1217\bookThen, clone the companion repository:
git clone -b 3rd-edition https://github.com/wesm/pydata-book.gitThis creates the folder:
C:\cmsc-1217\book\pydata-book\
If you are in CMSC-2208 Introduction to Machine Learning
First, move into your book folder:
cd C:\cmsc-2208\bookThen, clone the companion repository:
git clone https://github.com/amueller/introduction_to_ml_with_python.gitThis creates the folder:
C:\cmsc-2208\book\introduction_to_ml_with_python\
Note: If you see a message that the folder already exists, that usually means you already cloned the repository. That is fine—do not clone it again.
11) Start Jupyter Notebook in the correct folder (choose yourcourse)
You will start the Jupyter Notebook (Classic) server from your course-work folder. This ensures that when the browser opens, you immediately see the files you are expected to edit and submit.
Run the commands for your course only. Run them one at a time, pressing Enter after each command.
If you are in CMSC-1217 Introduction to Data Analytics
First, confirm you are in the correct course environment. Conda environments are activated per terminal window. That means:
- If you are using the same Anaconda/Miniconda Prompt window as earlier steps, your environment may already be active.
- If you opened a new terminal window (or restarted your computer), you must activate the environment again.
Run:
conda activate pydata-bookCheck: your prompt should begin with (pydata-book).
Next, move into your course work folder:
cd C:\cmsc-1217\course-workThen start Jupyter Notebook (Classic):
jupyter notebookIf you are in CMSC-2208 Introduction to Machine Learning
First, confirm you are in the correct course environment. Conda environments are activated per terminal window. That means:
- If you are using the same Anaconda/Miniconda Prompt window as earlier steps, your environment may already be active.
- If you opened a new terminal window (or restarted your computer), you must activate the environment again.
Run:
conda activate cmsc-2208Check: your prompt should begin with (pydata-book).
Next, move into your course work folder:
cd C:\cmsc-2208\course-workThen start Jupyter Notebook (Classic):
jupyter notebookA browser tab will open showing the contents of your course-work folder.
Important: Leave the terminal window open while you use Jupyter Notebook. That terminal is running the notebook server. If you close it, Jupyter will stop.
Accessing the book folder (when needed)
The course keeps course-work (your work) and book (reference materials) separate on purpose. When you need to view a book notebook:
Start a second Jupyter Notebook server in the book folder.
- Open a second Anaconda/Miniconda Prompt window
- Activate the same environment
cdinto thebookfolder- Run
jupyter notebook
For CMSC-1217 (run each command seperately):
conda activate pydata-book
cd C:\cmsc-1217\book
jupyter notebookFor CMSC-2208 (run each command seperately):
conda activate cmsc-2208
cd C:\cmsc-2208\book
jupyter notebookThis opens a second browser tab rooted in the book folder.
12) Create your first notebook and confirm the environment
- In your browser, go to the file list page (the page that shows folders/files).
- If you are currently inside a notebook, click File → Open… to return to the file list.
- Click New (top-right), then select Python 3 (ipykernel).
- In the first cell, run:
import sys
sys.executable- Confirm the path includes your course environment:
- CMSC-1217:
\\envs\\pydata-book\\ - CMSC-2208:
\\envs\\cmsc-2208\\
Why this matters: The kernel name shown in menus can vary, but sys.executable reliably confirms the notebook is using the correct environment.
13) Stop JupyterLab when finished
Go back to the terminal that started JupyterLab and press:
- Ctrl + C, then type
yif prompted.
Optional (CMSC-1217): IPython in the terminal
CMSC-1217 only: You will use IPython for interactive exploration.
In Anaconda/Miniconda Prompt:
conda activate pydata-book
IPythonYou should see an In [1]: prompt.
To exit:
exit()Common issues and solutions
Issue: Imports fail inside a notebook
Most common cause: the wrong environment/kernel is active.
Solution
- In the notebook, run
sys.executableto confirm the environment path. - If it is incorrect, switch the notebook kernel to the correct one:
- Kernel → Change Kernel (select the environment for your course)
Issue: JupyterLab opens in the wrong folder
Solution: cd into the correct course-work folder before starting JupyterLab.
Issue: You forgot to activate the environment
Solution: close JupyterLab (Ctrl+C), then re-run the launch commands in Section 11.