[This is a brief note so I don't forget how to do this, and will probably be technically obsolete before long!]
Essentia is an "Open-source library and tools for audio and music analysis, description and synthesis" (https://essentia.upf.edu)
If you use Jupyter Lab / notebooks and therefore manage your Python environments using Anaconda, AND your machine is macOS, you will not be able to install Essentia out of the box. This is because:
pip install essentiais currently Linux onlybrew install essentia(https://github.com/MTG/homebrew-essentia) is incompatible with Anacondaconda install essentiadoes not (yet) exist (MTG/essentia#777)
If you try to install Essentia from source (https://essentia.upf.edu/documentation/installing.html) using an Anaconda environment on macOS, you will find that a bug in CPython means that ./waf configure [...] fails:
However:
- homebrew's Python does not suffer from the same issue
- The issue above is only relevant in the
configurestep and not theinstallsteps.
So! A hacky, ugly, probably broken somewhere/somehow workaround, is:
- Do
./waf configure [...]using Python installed via homebrew (brew install python) rather than Anaconda - Then complete the rest of the installation using Anaconda's Python
Your essentia installation may end up in /usr/local/lib/python3.7/site-packages/, so you then need to add this to your Anaconda path:
import sys
sys.path.append('/usr/local/lib/python3.7/site-packages/') # not permanent
Now you should be able to import essentia from your Anaconda environment.
Yes, I did say it's ugly.
Hey! Here is an noobs step-by-step guide for installing essentia for anaconda on mac osx:
1 - Install anaconda
2 - install homebrew
3 - Install command line tools for XCode. Open terminal and type:
xcode-select --install4 - Install essentia prerequisites, on terminal type the following:
brew install pkg-config gcc readline sqlite gdbm freetype libpng5 - Install essentia dependencies, on terminal type the following:
brew install libyaml fftw ffmpeg libsamplerate libtagInstalling essentia:
6 -On Terminal, run the following line to install essentia's latest version. It will take a while and use a lot of cpu because many tests will ensure that all the algorithms are working properly (./waf part of the installation).
brew install essentia --HEADIf there are no big warnings then you have installed it successfully.
7 - Essentia will not be installed in the default location of conda packages, so we can manage this in two ways:
Option 1 - If you want to set essentia as a default package, so you dont need to add a path to it all the time, run the following line on terminal:
conda-develop /usr/local/lib/python3.7/site-packages/Now you can open spyder, jupiter, IPython console or open python on terminal and you will be able to load essentia with
import essentiaOption 2 - If you want to use essentia only ocasionaly, then you can open spyder, jupiter, IPython console or open python on terminal and run the following:
then load essentia with
import essentia