This chapter installs the supported course baseline:
Miniforge, which provides Python and the
condaenvironment manager;one isolated environment named
comp521; andVS Code with the Python and Jupyter extensions.
Project 1 needs NumPy, Matplotlib, and a notebook kernel. Later project briefs will name any additional packages they require.
Why use an environment?¶
An environment is a named collection of one Python interpreter and its
packages. Activating comp521 gives course work a stable place without
modifying the Python that your operating system may use.
computer
├── system software ← leave this alone
└── comp521 environment ← course Python and packagesIsolation prevents many package conflicts. It does not, by itself, make every computer byte-for-byte identical; project repositories and project-specific instructions own any stricter dependency contract.
Step 1: Install Miniforge¶
Download the installer for your operating system and processor from the official Miniforge download page.
If you are unsure which processor you have, run
uname -min Terminal.arm64means Apple Silicon;x86_64means Intel.Download the official signed
.pkginstaller for Apple Silicon or Intel, then open the downloaded package.Install for your user, accept the default location, and allow the installer to initialize your shell.
Close every Terminal window and open a new one.
Download the matching Linux shell installer.
In Terminal, go to the directory containing it, usually
cd ~/Downloads.Run the downloaded installer, for example:
bash Miniforge3-Linux-x86_64.shUse the actual filename you downloaded. Accept the default user location and answer yes when asked to initialize conda.
Close the terminal and open a new one.
Install the matching Windows Miniforge installer for Just Me, using the default location.
Open Miniforge Prompt from the Start menu and run:
conda init bashClose Miniforge Prompt and all Git Bash windows, then open a new Git Bash window.
This connects the Miniforge installation to the Bash terminal used in Chapter
If
condais not found, preserve the exact message and use the help route below instead of changing systemPATHentries by guesswork.
Verify the installation in a fresh terminal:
conda --versionA version number is success. If the command is not found, first confirm that you opened a new terminal after installation.
Step 2: Create the course environment¶
Create the minimal P1 environment once:
conda create --name comp521 python=3.11 numpy matplotlib jupyter ipykernel ghReview the proposed package plan, then enter y when conda asks whether to
proceed. Activate the environment:
conda activate comp521Your prompt should now include (comp521). Verify the interpreter and core
imports:
which python
python -c "import sys; print(sys.executable)"
python --version
python -c "import numpy, matplotlib; print('COMP 521 imports work')"
gh --versionBoth interpreter-path commands should point inside the comp521 environment.
which python is convenient in Git Bash and other Bash-compatible shells;
python -c "import sys; print(sys.executable)" works across shells. Python
should report version 3.11, the import command should print its success message,
and gh should report a GitHub CLI version. Installing gh in the same
cross-platform environment gives every supported operating system the browser
authentication path used in Chapter 3.
Daily environment commands¶
| Command | Purpose |
|---|---|
conda activate comp521 | enter the course environment |
conda deactivate | leave the current environment |
conda env list | show available environments |
conda list | show packages in the active environment |
which python | show which Python a Bash-compatible shell will run |
python -c "import sys; print(sys.executable)" | show the active Python across shells |
Step 3: Install VS Code¶
Download and install Visual Studio Code.
Open the Extensions view with
Ctrl + Shift + X(Windows/Linux) orCommand + Shift + X(macOS).Install these two extensions from Microsoft:
Python
Jupyter
No theme, formatter, AI assistant, or extension bundle is required.
Open a project and select its kernel¶
From a project directory, try:
code .If code is not available in your shell, use File → Open Folder in VS
Code. On macOS you may optionally install the shell command from the Command
Palette with Shell Command: Install ‘code’ command in PATH.
For a Python file, open the Command Palette and choose Python: Select
Interpreter, then select comp521. For a notebook, use the kernel picker at
the upper right and select the Python kernel from comp521. VS Code records
this choice per project folder.
Local notebook check¶
Create an untitled notebook only for this check, select the comp521 kernel,
and run:
import numpy as np
import matplotlib.pyplot as plt
x = np.linspace(0.0, 1.0, 5)
plt.plot(x, x**2, marker="o")
plt.xlabel("x")
plt.ylabel("x²")
plt.show()Success means the cell completes and displays one labeled curve. Close the untitled notebook without saving. This local check establishes that your laptop is ready to use Python and Jupyter in Thursday’s class.
AI completion settings¶
The authoritative rules are in the AI Use & Growth Mindset Policy. During Projects 1–3, automatic AI-generated code completions must be disabled because core solution code is your work. Disable Copilot, Cursor-style completion, or any comparable generative extension if it is installed.
Normal editor features such as syntax highlighting, bracket matching, documentation pop-ups, and ordinary IntelliSense may remain enabled. The policy also permits defined tutoring and verification uses after a genuine attempt; it does not impose a blanket ban on asking for explanations.
Setup evidence¶
Before continuing, confirm:
A new terminal recognizes
conda.conda activate comp521changes the prompt.which pythonpoints inside thecomp521environment.python -c "import sys; print(sys.executable)"points inside the same environment.NumPy and Matplotlib import without error.
gh --versionreports a GitHub CLI version.VS Code has the Microsoft Python and Jupyter extensions.
A notebook can select the
comp521kernel and display the test plot.Automatic AI code completion is disabled for the Phase 1 projects.
Complete this local setup check before class Thursday, August 27. The separate Project 1 Repository Check is completed by pushing one setup commit in Chapter 3.
Troubleshooting from evidence¶
| Symptom | Bounded next step |
|---|---|
conda: command not found | Open a new terminal. Confirm Miniforge installed for your user. On Windows, try the exact conda init bash step from Miniforge Prompt once. |
EnvironmentNameNotFound: comp521 | Run conda env list. If the environment is absent, repeat the create command; if it exists under another name, preserve the output and ask for help. |
ModuleNotFoundError | Run conda activate comp521, which python, python -c "import sys; print(sys.executable)", and conda list <package>. |
| VS Code shows the wrong Python | Open the project folder, then select the comp521 interpreter or kernel again. |
| Kernel will not start | Record the VS Code notification and Jupyter output; confirm python -c "import ipykernel" works in the active environment. |
| Installation stalls or cannot reach a server | Save the complete network error and try the same command once on a stable network. Do not add an unknown proxy or clear caches blindly. |
Post a shared setup question on the Canvas discussion board or use Canvas Inbox
for a private issue. Include your operating system, exact command or UI action,
complete error, and the outputs of conda env list and which python when
relevant.