# Set up environment

## In this learning path

- [Introduction](https://learn.arm.com/learning-paths/embedded-and-microcontrollers/cmsisdsp-dev-with-python/)
- [CMSIS-DSP Python package](https://learn.arm.com/learning-paths/embedded-and-microcontrollers/cmsisdsp-dev-with-python/how-to-1/)
- [Set up environment](https://learn.arm.com/learning-paths/embedded-and-microcontrollers/cmsisdsp-dev-with-python/how-to-2/)
- [Load an audio file](https://learn.arm.com/learning-paths/embedded-and-microcontrollers/cmsisdsp-dev-with-python/how-to-3/)
- [Write a simple VAD](https://learn.arm.com/learning-paths/embedded-and-microcontrollers/cmsisdsp-dev-with-python/how-to-4/)
- [Write a noise suppression algorithm](https://learn.arm.com/learning-paths/embedded-and-microcontrollers/cmsisdsp-dev-with-python/how-to-5/)
- [Write the CMSIS-DSP Q15 implementation](https://learn.arm.com/learning-paths/embedded-and-microcontrollers/cmsisdsp-dev-with-python/how-to-6/)
- [Convert the CMSIS-DSP Python to C](https://learn.arm.com/learning-paths/embedded-and-microcontrollers/cmsisdsp-dev-with-python/how-to-7/)
- [Develop your knowledge](https://learn.arm.com/learning-paths/embedded-and-microcontrollers/cmsisdsp-dev-with-python/how-to-8/)
- [Next Steps](https://learn.arm.com/learning-paths/embedded-and-microcontrollers/cmsisdsp-dev-with-python/_next-steps/)

To follow this Learning Path, you’ll need to install a few additional Python packages alongside CMSIS-DSP.

## Create a Python virtual environment

Start by installing the packages in a Python virtual environment. For example, you can use:

```
python -m venv cmsis-dsp-venv
```

If required, activate the environment.

## Install CMSIS-DSP

Now install the required packages, starting with CMSIS-DSP:

```
pip install cmsisdsp
```

This will also install `NumPy`, which is a dependency of the CMSIS-DSP Python package.

## Install Jupyter

You’ll be working with a Jupyter notebook, so install the `jupyter` package:

```
pip install jupyter
```

## Install additional tools

Finally, you’ll also need packages for reading sound files, playing sound using widgets, and displaying plots:

```
pip install soundfile ipywidgets matplotlib
```

## Launch Jupyter and set up your notebook

You can now launch the Jupyter notebook with the following command:

```
jupyter notebook
```

A browser window should open, displaying the source tree.

Create a new Jupyter notebook by clicking **New** and selecting **Python 3 (ipykernel)**. The new notebook is called `Untitled`. Rename it to something descriptive, for example `cmsis-dsp`.

Now import all the required packages by copying and running the following Python code into your notebook and run the cell (Shift+Enter).

> **Note**  
> All the Python code blocks in this Learning Path are intended to be executed in the same Jupyter notebook.

```python
import cmsisdsp as dsp
import cmsisdsp.fixedpoint as fix
from cmsisdsp import datatype as dt
import numpy as np
from numpy.lib.stride_tricks import sliding_window_view

# Package for plotting
import matplotlib.pyplot as plt

# Package to display audio widgets in the notebook and upload sound files
import ipywidgets
from IPython.display import display, Audio

# To convert a sound file to a NumPy array
import io
import soundfile as sf

# To load test patterns from the Arm Virtual Hardware Echo Canceller demo
from urllib.request import urlopen
```

You’re now ready to move on and set up the audio files you’ll use for processing.
