Mac and Linux
OpenSoundscape can be installed on Mac and Linux machines with Python >=3.10 using the pip command pip install opensoundscape==0.13.0. We strongly recommend installing OpenSoundscape in a virtual environment to prevent dependency conflicts.
Below are instructions for installation with two package managers:
conda: Python and package management through Anaconda, a package manager popular among scientific programmersvenv: Python’s included virtual environment manager,venv
Feel free to use another virtual environment manager (e.g. virtualenvwrapper) if desired.
Installation via Anaconda
Install Anaconda if you don’t already have it.
Download the installer here, or
follow the installation instructions for your operating system.
Create a Python (>=3.10) conda environment for opensoundscape:
conda create --name opensoundscape pip python=3.10(you can leave out the requirement of python 3.10, just make sure you have at least python 3.10)Activate the environment:
conda activate opensoundscapeInstall opensoundscape using pip:
pip install opensoundscape==0.13.0Deactivate the environment when you’re done using it:
conda deactivate
Intel-chip Macs (not Apple Silicon)
You may need to install pytorch from conda-forge since newer versions are not visible to pip. Run these lines in Termina, replacing NAME with the desired name of your environment:
conda create -n NAME python=3.11
conda activate NAME
conda install pytorch==2.5.1 torchvision==0.20.1 torchaudio==2.5.1 -c conda-forge
pip install opensoundscape==0.13.0
Installation via venv
Download Python (>=3.10) from this website.
Run the following commands in your bash terminal:
Check that you have installed Python >=3.10:
python3 --versionChange directories to where you wish to store the environment:
cd [path for environments folder]Tip: You can use this folder to store virtual environments for other projects as well, so put it somewhere that makes sense for you, e.g. in your home directory.
Make a directory for virtual environments and
cdinto it:mkdir .venv && cd .venvCreate an environment called
opensoundscapein the directory:python3 -m venv opensoundscapeActivate/use the environment:
source opensoundscape/bin/activateInstall OpenSoundscape in the environment:
pip install opensoundscape==0.13.0Once you are done with OpenSoundscape, deactivate the environment:
deactivateTo use the environment again, you will have to refer to absolute path of the virtual environments folder. For instance, if I were on a Mac and created
.venvinside a directory/Users/MyFiles/CodeI would activate the virtual environment using:source /Users/MyFiles/Code/.venv/opensoundscape/bin/activate
For some of our functions, you will need a version of ffmpeg >= 0.4.1. On Mac machines, ffmpeg can be installed via brew.