Technical Setup#

This guide walks you through everything you need to prepare your development environment for the course. By the end, you will have:

  • Python installed

  • Visual Studio Code (VSCode) installed

  • AI features (such as GitHub Copilot) disabled

  • A course folder with a Python virtual environment

  • Pyquist installed

  • Your virtual environment registered as a Jupyter kernel

  • VSCode configured to use your virtual environment

  • A Jupyter notebook that successfully runs Python code

  • Assignment 1 downloaded and opened

Important

These setup instructions apply to all assignments, both and . For the subset of open-ended assignments that allow AI tools (starting with Assignment 3 released on Sep 7), see the dedicated AI Setup page.

If you follow these instructions carefully, you should not need to troubleshoot anything else before beginning the course.

Tip

If you’re having any issues with installations, come to OH, email us, or check the FAQ section below.

1. Install Python#

Download the latest stable version of Python from https://www.python.org/downloads/. Choose the correct installer for your operating system.

  1. Download the Windows installer (.msix).

  2. Run the installer.

  3. When a command prompt window appears, say “y” to add Python to your PATH. This is important!

  4. Answer the remaining prompts to complete the installation (it doesn’t hurt to accept the defaults).

  5. After installation, open Command Prompt and verify the installation:

python --version

If you install using the .msi installer, ensure that you click the “Add Python to PATH” checkbox during installation.

  1. Download the macOS installer.

  2. Run the installer.

  3. Accept the defaults.

  4. After installation, open Terminal and verify the installation:

python3 --version

Many Linux distributions already include Python.

Open a terminal and run

python3 --version

If Python is missing, install it using your distribution’s package manager.

Ubuntu/Debian:

sudo apt update
sudo apt install python3 python3-venv python3-pip

Verify installation afterwards:

python3 --version

2. Install Visual Studio Code#

Download VSCode from https://code.visualstudio.com/ and follow their installation steps. Once installation is complete, launch VSCode.

3. Install the Jupyter Extension#

Inside VSCode:

  1. Click the Extensions icon on the left sidebar.

  2. Search for Jupyter.

  3. Install the extension published by Microsoft.

You may also wish to install the Python extension from Microsoft if it is not installed automatically.

4. Disable AI Assistance#

This course is designed for you to write and understand your own code. AI tools can interfere with learning the material, though there are times in this course when it is allowed to use them. We will explicitly tell you when it is allowed to use AI tool, though your default assumption should be that they are not allowed . For now, please disable any AI coding assistants you have installed.

If GitHub Copilot or other AI assistants are installed:

  1. Open the Extensions panel.

  2. Search for GitHub Copilot.

  3. Click the gear icon.

  4. Select Disable.

Make sure the Copilot icon GitHub Copilot icon is absent from the bottom right of your VSCode.

If you have another AI coding extension installed (Cursor AI, Codeium, Continue, etc.), disable it as well.

You can always re-enable these extensions after the course if desired.

6. Create a Virtual Environment#

Open a terminal inside VSCode and ensure your present working directory is the course folder, as this is where you are expected to keep your virtual environment. You can open a terminal by selecting Terminal → New Terminal.

python -m venv .venv
python3 -m venv .venv

This creates a virtual environment named .venv inside your course folder.

7. Activate the Virtual Environment#

.venv\Scripts\activate
source .venv/bin/activate

You should now see something similar to(.venv) at the beginning of your terminal prompt. Note that VSCode may automatically activate the virtual environment for you when you open a terminal in the future, but it is good to know how to do it manually. You can always deactivate the virtual environment by running deactivate.

8. Install Pyquist#

With the virtual environment activated, install Pyquist:

pip install --upgrade pyquist

Wait for installation to finish.

You can verify it by running

pyquist -v

You should see a version string print out.

Finally, test if pyquist can talk to your computer audio:

python -c "import pyquist as pq; pq.play(pq.Audio.from_file(pq.paths.TEST_SOUND))"

You should hear a sound come out of your speakers or headphones. If not, run pyquist devices and configure your default input/output device. Once configured, run the above command to confirm.

9. Register IPython Kernel#

VSCode needs a Jupyter kernel that points at your virtual environment. Register one so it appears by name in every notebook you open.

With your virtual environment still activated, install ipykernel:

pip install ipykernel

Then register the environment as a kernel named ICM:

python -m ipykernel install --user --name=icm --display-name "ICM"

You only need to do this once. If you ever rebuild your virtual environment, run both commands again.

10. Connect VSCode to Your Virtual Environment#

In VSCode, press Ctrl+Shift+P on Windows/Linux or ⌘+Shift+P on macOS.

Search for

Python: Select Interpreter

Choose the interpreter located inside .venv

It should look something like .venv/bin/python (macOS/Linux) or .venv\Scripts\python.exe (Windows)


11. Create Your First Notebook#

Create a new file named hello.ipynb

To connect it to the kernel you registered, press Select Kernel in the upper-right corner of the notebook, then choose:

  1. Select Another Kernel…

  2. Jupyter Kernel…

  3. ICM

In the first cell, type print("Hello, world!").

Run the cell by clicking the Run All button at the top, pressing the triangle next to the cell, or pressing Ctrl+Enter. If everything is working correctly, you should see the output below the cell.

Finally, test Pyquist in your notebook by creating a new cell:

import pyquist as pq
pq.play(pq.Audio.from_file(pq.paths.TEST_SOUND))

Congratulations! You now have Python, VSCode, Jupyter, and your virtual environment working together.

12. Download Assignment 1#

  1. Open Assignment 1 in a new tab

  2. Download the Assignment 1 ZIP file from the course website.

  3. Drag it into your course folder in VSCode

Open up the terminal

mkdir Assignment1
mv starter.zip Assignment1
cd Assignment1
unzip starter.zip
rm starter.zip
  1. Extract (unzip) it.

Your folder should now look something like

~/Documents/ICM/
    .venv/
    Assignment1/{ICMF26Assignment01.ipynb,answers.txt}
    hello.ipynb

Open the Assignment 1 notebook in VSCode, press Select Kernel, choose the ICM kernel, and you’re ready to begin!

13. (Optional) Install Audacity#

Audacity is a free, open-source audio editor. Nothing in this course requires it, but it is handy for recording, trimming, and inspecting audio files.

  1. Navigate to audacityteam.org

  2. Click Download without MuseHub

  3. Run the installer for your platform

Alternatively, download the installer directly from the latest GitHub release.

Fun fact

Audacity was developed right here at CMU by Roger Dannenberg (the original instructor for this course) and his PhD students in the CMU Computer Music Project.

Frequently Asked Questions#

VSCode can’t find Python

Open the Command Palette and select

Python: Select Interpreter

Choose the interpreter inside .venv. Note: Be sure to check the leading slash in the path. If you see a path like /usr/bin/python or C:\Python39\python.exe, you are not using the virtual environment. More subtly, if you see a path like /.venv/bin/python, you are still not using the correct environment. For macOS and Linux, there should not be a leading slash before .venv.

I accidentally installed packages globally

Activate your virtual environment and reinstall them there. You generally do not need to uninstall the global copy.

My notebook is using the wrong Python

Click the kernel selector in the upper-right corner of the notebook and choose the ICM kernel (Select Another Kernel… > Jupyter Kernel… > ICM).

pip says the package is installed, but Python can’t import it

This almost always means VSCode is using a different Python interpreter than the one where the package was installed.

Verify that:

  • your virtual environment is activated

  • VSCode is using the .venv interpreter

Something still isn’t working

Before asking for help, check:

  • Is Python >=3.10 installed?

  • Is your virtual environment activated?

  • Is VSCode using the .venv interpreter?

  • Is the notebook using the ICM kernel?

  • Did pip install pyquist complete successfully?

If you’ve checked all of these and still have issues, include screenshots of the error and the commands you ran when asking for help.